Determine whether input is matrix
ismatrix(V)
ismatrix(
returns
logical 1 (V
)true
) if size
(V
)
returns [m n]
with nonnegative integer values m
and n
,
and logical 0 (false
) otherwise.
Create three vectors:
V1 = rand(5,1); V2 = rand(5,1); V3 = rand(5,1);
Concatenate the vectors and check that the result is a matrix. ismatrix
returns 1:
M = cat(2,V1,V2,V3); ismatrix(M) ans = 1