Mercurial > hg > mauch-mirex-2010
annotate _FullBNT/KPMtools/isvector.m @ 9:4ea6619cb3f5 tip
removed log files
author | matthiasm |
---|---|
date | Fri, 11 Apr 2014 15:55:11 +0100 |
parents | b5b38998ef3b |
children |
rev | line source |
---|---|
matthiasm@8 | 1 function p = isvector(v) |
matthiasm@8 | 2 % ISVECTOR Returns 1 if all but one dimension have size 1. |
matthiasm@8 | 3 % p = isvector(v) |
matthiasm@8 | 4 % |
matthiasm@8 | 5 % Example: isvector(rand(1,2,1)) = 1, isvector(rand(2,2)) = 0. |
matthiasm@8 | 6 |
matthiasm@8 | 7 s=size(v); |
matthiasm@8 | 8 p = (ndims(v)<=2) & (s(1) == 1 | s(2) == 1); |
matthiasm@8 | 9 %p = sum( size(v) > 1) <= 1; % Peter Acklam's solution |