Skip to content

Commit 4fa8b69

Browse files
committed
make this work for a vector of symbols which is a symfun type
1 parent 4304456 commit 4fa8b69

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

isvec.m

+8-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
% - Differs from MATLAB builtin function ISVECTOR which returns true
1111
% for the case of a scalar, ISVEC does not.
1212
% - Gives same result for row- or column-vector, ie. 3x1 or 1x3 gives true.
13+
% - Works for a symbolic math symfun.
1314
%
1415
% See also ISHOMOG, ISROT.
1516

@@ -40,6 +41,11 @@
4041
if nargin == 1
4142
l = 3;
4243
end
43-
d = size(v);
44-
h = logical( length(d) == 2 && min(d) == 1 && numel(v) == l );
44+
if isa(v, 'symfun')
45+
h = logical( length(formula(v)) == l);
46+
else
47+
d = size(v);
48+
h = logical( length(d) == 2 && min(d) == 1 && numel(v) == l );
49+
end
50+
end
4551

0 commit comments

Comments
 (0)