Skip to content

Commit

Permalink
Version 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lmendo committed Dec 19, 2015
1 parent 8de3398 commit 34c182d
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 97 deletions.
17 changes: 0 additions & 17 deletions .gitattributes

This file was deleted.

55 changes: 0 additions & 55 deletions .gitignore

This file was deleted.

Binary file modified MATL_spec.pdf
Binary file not shown.
Binary file modified funDef.mat
Binary file not shown.
38 changes: 19 additions & 19 deletions funDef.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Z! 1 1 1 1 1 1 true true out{1} = full(in{1}); convert sparse matrix to full mat
"
X" 2 inf 3 1 1 1 true true out{1} = repmat(in{:}); replicate and tile array \matlab+repmat+
Y" 2 inf 2 1 1 1 true true out{1} = repelem(in{:}); replicate elements of array \matlab+repelem+ (run-length decoding)
Z"
Z" 1 1 1 1 1 1 true true out{1} = blanks(in{1}); string of blanks \matlab+blanks+
# 1 1 1 0 0 0 false false S_OUT = STACK{end}; STACK(end) = []; output specification specify outputs for next function
% The numbers of inputs and outputs for # are not used by the code, but are used for generating the help file
X#
Expand Down Expand Up @@ -359,29 +359,30 @@ O 0 inf 0 1 1 1 true true if numel(in)==0, out{1} = 0; else out{1} = zeros(in{:}
XO 1 4 1 1 1 1 true true out{1} = datestr(in{:}); string representation of date \matlab+datestr+
YO 1 6 1 1 1 1 true true out{1} = datenum(in{:}); serial date number \matlab+datenum+
ZO 1 3 1 1 6 1 true true [out{:}] = datevec(in{:}); date components \matlab+datevec+
P 1 2 1 1 1 1 true true out{1} = flip(in{:}); flip the order of elements \matlab+flip+
XP 1 2 1 1 1 1 true true out{1} = pdist(in{:}); pairwise distances between points \matlab+pdist+
YP 2 5 2 1 1 1 true true out{1} = pdist2(in{:}); pairwise distances between two sets of points \matlab+pdist2+
ZP 2 3 2 1 1 1 true true if numel(in)==2, out{1} = polyval(in{:}); else out{1} = polyval(in{1},in{2},[],in{3}); end evaluate polynomial If $2$ inputs \matlab+p+ and \matlab+x+: \matlab+y=polyval(p,x)+. If $3$ inputs \matlab+p+, \matlab+x+ and \matlab+mu+: \matlab+y=polyval(p,x,[],mu)+
P 1 2 1 1 1 1 true true out{1} = flip(in{:}); flip the order of elements \matlab+flip+. \sa \matl+XP+
XP 1 1 1 1 1 1 true true out{1} = flipud(in{:}); flip array in up-down direction \matlab+flipud+. \sa \matl+P+
YP 0 0 0 1 1 1 true true out{1} = pi; pi \matlab+pi+
ZP 2 5 2 1 1 1 true true out{1} = pdist2(in{:}); pairwise distances between two sets of points \matlab+pdist2+. Only predefined distance functions are allowed
Q
XQ
YQ
ZQ
ZQ 2 3 2 1 1 1 true true if numel(in)==2, out{1} = polyval(in{:}); else out{1} = polyval(in{1},in{2},[],in{3}); end evaluate polynomial If $2$ inputs \matlab+p+ and \matlab+x+: \matlab+y = polyval(p,x)+. If $3$ inputs \matlab+p+, \matlab+x+ and \matlab+mu+: \matlab+y = polyval(p,x,[],mu)+
R 1 2 1 1 1 1 true true out{1} = triu(in{:}); upper triangular part \matlab+triu+. \sa \matl+XR+.
XR 1 1 1 1 1 1 true true out{1} = triu(in{1},1); upper triangular part, above diagonal \matlab+triu(..., 1)+. \sa \matl+R+.
YR 1 2 1 1 1 1 true true out{1} = tril(in{:}); lower triangular part \matlab+tril+. \sa \matl+ZR+.
ZR 1 1 1 1 1 1 true true out{1} = tril(in{1},-1); lower triangular part, without diagonal \matlab+tril(..., -1)+. \sa \matl+YR+.
S 1 3 1 1 2 1 true true if numel(in)==2 && in{2}<0, in{2}=-in{2}; in{3} = 'descend'; end, [out{:}] = sort(in{:}); sort \matlab+sort+. If $2$ inputs: a negative value of the second input corresponds to descending order
XS 1 2 1 1 2 1 true true [out{:}] = sortrows(in{:}); sort rows \matlab+sortrows+
YS 2 3 2 1 1 1 true true out{1} = circshift(in{:}); circular shift \matlab+circshift+
ZS 1 2 1 1 1 1 true true out{1} = squareform(in{:}); reformat distance matrix between upper triangular and square form \matlab+squareform+
ZS 1 4 1 1 1 1 true true out{1} = std(in{:}); standard deviation \matlab+std+
T
XT 0 0 0 1 1 1 true true out{1} = pi; pi \matlab+pi+
XT
YT 1 2 2 1 1 1 true true out{1} = toeplitz(in{:}); Toeplitz matrix \matlab+toeplitz+
ZT
U
XU
YU
U 1 1 1 1 1 1 true true out{1} = str2double(in{:}); convert string to double precision value \matlab+str2double+
XU 1 1 1 1 2 1 true true assert(isempty(regexp(in{1}, '^[^'']*(''[^'']*''[^'']*)*[a-zA-Z]{2}', 'once')), 'MATL:runtime', 'MATL run-time error: content not allowed') convert string matrix to numeric array \matlab+str2num+ with content checking
[out{:}] = str2num(in{:});
YU 1 2 1 1 1 1 true true out{1} = num2str(in{:}); convert numbers to a string \matlab+num2str+
ZU
V
XV
Expand All @@ -392,7 +393,7 @@ XW
YW
ZW
X
XX 2 9 2 1 6 1 true true [out{:}] = regexp(in{:}); match regular expression \matlab+regexp+
XX 2 9 2 1 6 1 true true if numel(in)==2, in{3} = 'match'; end, [out{:}] = regexp(in{:}); match regular expression \matlab+regexp+. With $2$ inputs: \matlab+regexp(..., ..., 'match')+
YX 3 5 3 1 1 1 true true [out{:}] = regexprep(in{:}); replace string using regular expression \matlab+regexprep+
ZX
Y
Expand Down Expand Up @@ -512,14 +513,13 @@ r 0 inf 0 1 1 1 true true out{1} = rand(in{:}); uniformly distributed pseudorand
Xr 0 inf 0 1 1 1 true true if numel(in)==0, in{1} = 1; end; out{1} = randn(in{:}); normally distributed pseudorandom numbers \matlab+randn+
Yr 1 inf 1 1 1 1 true true if numel(in)==1, in{2} = 1; end; out{1} = randi(in{:}); pseudorandom integers from uniform discrete distribution \matlab+randi+. If $1$ input: \matlab+randi(...,1)+
Zr 2 4 2 1 1 1 true true out{1} = randsample(in{:}); random sample \matlab+randsample+. Does not support stream specification
s 1 4 1 1 1 1 true true out{1} = sum(in{:}); sum \matlab+sum+
Xs 1 3 1 1 1 1 true true out{1} = cumsum(in{:}); cumulative sum \matlab+cumsum+
Ys 1 2 1 1 1 1 true true out{1} = num2str(in{:}); convert numbers to a string \matlab+num2str+
Zs 1 4 1 1 1 1 true true out{1} = std(in{:}); standard deviation \matlab+std+
s 1 4 1 1 1 1 true true out{1} = sum(in{:}); sum \matlab+sum+. \sa \matl+Xs+
Xs 1 3 1 1 1 1 true true out{1} = sum(in{1},1,in{2:end}); sum along first dimension \matlab+sum(..., 1, ...)+. \sa \matl+s+
Ys 1 3 1 1 1 1 true true out{1} = cumsum(in{:}); cumulative sum \matlab+cumsum+
Zs
t 0 inf 1 0 0 0 false true out = in; duplicate duplicate elements in stack
Xt 1 1 1 1 1 1 true true out{1} = str2double(in{:}); convert string to double precision value \matlab+str2double+
Yt 1 1 1 1 2 1 true true assert(isempty(regexp(in{1}, '^[^'']*(''[^'']*''[^'']*)*[a-zA-Z]{2}', 'once')), 'MATL:runtime', 'MATL run-time error: content not allowed') convert string matrix to numeric array \matlab+str2num+ with content checking
[out{:}] = str2num(in{:});
Xt
Yt
Zt 3 3 3 1 1 1 true true [out{:}] = strrep(in{:}); replace substring with another \matlab+strrep+
u 1 4 1 1 3 1 true true [out{:}] = unique(in{:}); unique \matlab+unique+. \sa \matl+Xu+.
Xu 1 3 1 1 3 1 true true [out{:}] = unique(in{1},'rows',in{2:end}); unique rows \matlab+unique(...,'rows',...)+. \sa \matl+u+.
Expand Down
Binary file modified help.mat
Binary file not shown.
7 changes: 5 additions & 2 deletions matl.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function matl(varargin)
indentCommentText = 1; % number of spaces before actual comment. Default value
pOutFile = 'MATLp.txt'; % temporary file for parsed code
cOutFile = 'MATLc.m'; % temporary file for compiled code
cOutFileNoExt = regexprep('MATLc.m', '\.m$', ''); % without extension. Needed to run file in olf Matlab versions
funDefMasterFile = 'funDef.txt'; % function definition master file
funDefMatFile = 'funDef.mat'; % function definition processed file
preLitMasterFile = 'preLit.txt'; % master file that defines predefined strings with (key, value) pairs
Expand Down Expand Up @@ -246,7 +247,8 @@ function matl(varargin)
%disp('--') %disp(repmat('-',size(str)))
pause
end
matl_run(S, pOutFile, cOutFile, [])
matl_run(S, pOutFile, cOutFileNoExt, []) % ...NoExt because a file name without extension is
% needed in old Matlab versions
end

% Run compiled program in debug mode, if required
Expand All @@ -255,7 +257,8 @@ function matl(varargin)
disp('Press any key to run MATL program in debug mode')
pause
end
matl_run(S, pOutFile, cOutFile, [S.compileLine])
matl_run(S, pOutFile, cOutFileNoExt, [S.compileLine]) % ...NoExt because a file name without
% extension is needed in old Matlab versions
end


Expand Down
6 changes: 5 additions & 1 deletion matl_compile.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
appendLines('% Set initial conditions', 0)
appendLines('warningState = warning;', 0);
appendLines('format compact; format long; warning(''off'',''all'');', 0) % clc
appendLines('rng(''shuffle'')', 0)
if exist('rng', 'file') % in case an old Matlab version is used
appendLines('rng(''shuffle'')', 0)
else
warning('MATL has not been able to seed random number generator')
end
appendLines('diary off; delete defout; diary defout', 0)
% For arrays with brackets or curly braces: F = false; T = true;
appendLines('F = false; T = true;', 0)
Expand Down
Binary file modified preLit.mat
Binary file not shown.
6 changes: 3 additions & 3 deletions preLit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ X8
15 'fro'
16 'Smallest'
17 'Largest'
18 'tomatrix'
19 'tovector'


X9
Expand Down Expand Up @@ -237,4 +235,6 @@ Y2
5 ['0':'9' 'A':'F']
11 'aeiou'
12 'AEIOU'
13 'aeiouAEIOU'
13 'aeiouAEIOU'
20 ['Mon';'Tue';'Wed'; 'Thu';'Fri';'Sat'; 'Sun']
21 [298 302 288 305 289 296 310]

0 comments on commit 34c182d

Please sign in to comment.