Skip to content

Commit

Permalink
add an ismatrix() function with tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Whiteknight committed Dec 3, 2009
1 parent 3f29530 commit d4c9a30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions t/functions/ismatrix.t
@@ -0,0 +1,3 @@
plan(2);
is(ismatrix(1), 0, "scalars are not matrices");
is(ismatrix([1]), 1, "matrices are matrices");
8 changes: 8 additions & 0 deletions toolbox/ismatrix.m
@@ -0,0 +1,8 @@
function what = ismatrix(var)
code = [".sub '' :anon"
" .param pmc x"
" $I0 = does x, 'matrix'"
" .return($I0)"
".end"];
what = pir(code, var);
endfunction

0 comments on commit d4c9a30

Please sign in to comment.