diff options
| author | Joel Martin <github@martintribe.org> | 2015-02-08 01:13:41 -0600 |
|---|---|---|
| committer | Joel Martin <github@martintribe.org> | 2015-02-08 23:51:08 -0600 |
| commit | d6624158bdf41e047ad8d0a9942238dc80649901 (patch) | |
| tree | 4138b0e5c597b65a690adbc933748dc0c1271b7a /matlab/core.m | |
| parent | ab6e6fae4e8935fca5fb33bd8645fe9cece18bb9 (diff) | |
| download | mal-d6624158bdf41e047ad8d0a9942238dc80649901.tar.gz mal-d6624158bdf41e047ad8d0a9942238dc80649901.zip | |
matlab: start of step4
Diffstat (limited to 'matlab/core.m')
| -rw-r--r-- | matlab/core.m | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/matlab/core.m b/matlab/core.m new file mode 100644 index 0000000..968b9a4 --- /dev/null +++ b/matlab/core.m @@ -0,0 +1,22 @@ +classdef core + methods(Static) + function n = ns() + n = containers.Map(); + n('=') = @(a,b) a==b; + n('<') = @(a,b) a<b; + n('<=') = @(a,b) a<=b; + n('>') = @(a,b) a>b; + n('>=') = @(a,b) a>=b; + n('+') = @(a,b) a+b; + n('-') = @(a,b) a-b; + n('*') = @(a,b) a*b; + n('/') = @(a,b) floor(a/b); + + n('list') = @(varargin) varargin; + n('list?') = @iscell; + n('empty?') = @(a) length(a) == 0; + n('count') = @(a) length(a); + end + end +end + |
