Skip to content

Commit

Permalink
Various changes (see description)
Browse files Browse the repository at this point in the history
* Expanded functionality of `sort`

* Added predefined literals

* Expanded funcionality of `)` `Y)` `Z)` to split arrays

* Corrected run-length encoding with cell arrays and with empty input

* The default number of outputs in `ndgrid` is now the number of inputs

* The input to `str2num` is automatically converted to char if it's not
char

* New `Xv` function to remove blanks

* `YG` has been extended with `imshow` and `imwrite` functionality
  • Loading branch information
lmendo committed Feb 5, 2016
1 parent c595a01 commit d6f488b
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 25 deletions.
Binary file modified doc/MATL_spec.pdf
Binary file not shown.
Binary file modified doc/function_table.pdf
Binary file not shown.
Binary file modified funDef.mat
Binary file not shown.
62 changes: 41 additions & 21 deletions funDef.txt

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion genHelp.m
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
commFormatted = {F.comment};
descrFormatted = {F.description};
descrFormatted = regexprep(descrFormatted, '\\matlab(.)(.*?)(\1)', '<strong>$2</strong>');
descrFormatted = regexprep(descrFormatted, '\\matl\+(.*?)\+', '<strong>$1</strong>'); %***make delimiter arbitrary here too
descrFormatted = regexprep(descrFormatted, '\\matl(.)(.*?)\1', '<strong>$2</strong>'); % delimiter can be any
descrFormatted = regexprep(descrFormatted, '\\comp{(.*?)}', '<strong>$1</strong>');
descrFormatted = regexprep(descrFormatted, '\\sa', 'See also');
descrFormatted = regexprep(descrFormatted, '\$(.*?)\$', '$1');
Expand Down Expand Up @@ -179,6 +179,8 @@
defOutStr = 'number of levels addressed according to input specification';%'if 0 inputs: current number of clipboard levels; if 1 input: 1';
case 'max(1,sum(ismember(in(3:end), {''start'' ''end'' ''tokenExtents'' ''match'' ''tokens'' ''names'' ''split''})))'
defOutStr = 'according to specified keywords';
case 'numel(in)'
defOutStr = 'number of inputs';
otherwise
error('Unrecognized default number of outputs')
end
Expand Down
Binary file modified help.mat
Binary file not shown.
6 changes: 4 additions & 2 deletions matl_compile.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

% Each MATLAB line is a string in cell array C.

% Variables related to MATL are uppercase: STACK, S_IN, S_OUT, CB_H--CB_L.
% Variables related to MATL are uppercase: STACK, S_IN, S_OUT, CB_G--CB_M.

% The MATL stack (variable 'STACK') is implemented in MATLAB as a dynamic-size cell, for two
% reasons:
Expand Down Expand Up @@ -328,11 +328,13 @@
end
newLines = [newLines, {...
sprintf('if isempty(S_OUT), S_OUT = %s; end', defOut) ...
sprintf('if isnumeric(S_OUT) && numel(S_OUT) == 1, if S_OUT < %s || S_OUT > %s, error(''MATL:runner'', ''MATL run-time error: incorrect output specification''), end', minOut, maxOut) ...
sprintf('if isnumeric(S_OUT) && numel(S_OUT) == 1, if S_OUT < %s || S_OUT > 2*(%s), error(''MATL:runner'', ''MATL run-time error: incorrect output specification''), end', minOut, maxOut) ...
sprintf('elseif islogical(S_OUT), if numel(S_OUT) < %s || numel(S_OUT) > %s, error(''MATL:runner'', ''MATL run-time error: incorrect output specification''), end', minOut, maxOut) ...
'else error(''MATL:runner'', ''MATL run-time error: output specification not recognized''), end' ...
sprintf('if isnumeric(S_OUT) && S_OUT > %s, S_OUT = [false(1,S_OUT-(%s+1)) true]; end', maxOut, maxOut) ...
'if isnumeric(S_OUT), nout = S_OUT; else nout = numel(S_OUT); end' ...
'out = cell(1,nout);' }];
% 2*(...) because a number in maxOut+1:2*maxOut corresponds to a logical vector with a single true value
% For logical S_IN we use nnz (the inputs are picked from the stack), but
% for logical S_OUT we use numel (the function is called with that many outputs)
if consume
Expand Down
Binary file modified preLit.mat
Binary file not shown.
14 changes: 13 additions & 1 deletion preLit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ X0
3 'rows'
4 'last'
5 'reverse'
6 'descend'
10 'first'
11 'forward'
12 'legacy'
13 'ascend'


X1
Expand Down Expand Up @@ -98,14 +100,24 @@ X6
1 'get'
2 'post'
3 'Timeout'
4 'png'
5 'ppm'
6 'gif'
7 'bmp'
9 'none'
11 'Frames'
12 'BackgroundColor'
13 'Index'
14 'Info'
15 'ReductionLevel'
16 'PixelRegion'
17 'V79Compatible'
17 'V79Compatible'
20 'Border'
21 'Colormap'
22 'DisplayRange'
23 'InitialMagnification'
24 'Parent'
25 'Reduce'


X7
Expand Down

0 comments on commit d6f488b

Please sign in to comment.