Any one give me an example for false output in ismatrix.

1 次查看(过去 30 天)
I wondering if anyone point out a input which gives false output for ismatrix

采纳的回答

Matt J
Matt J 2016-7-19
编辑:Matt J 2016-7-19
>> ismatrix(rand(3,3,3))
ans =
0
As more exotic example,
>> ismatrix(myclass)
ans =
0
where myclass is defined as follow,
classdef myclass
methods
function sz=size(obj)
sz=1;
end
end
end
  4 个评论
Matt J
Matt J 2016-7-19
From the help doc for ismatrix
ismatrix(M) returns logical 1 (true) if SIZE(M) returns [m n]
with nonnegative integer values m and n, and logical 0 (false) otherwise.

请先登录,再进行评论。

更多回答(1 个)

the cyclist
the cyclist 2016-7-19
M = zeros(2,3,5)
ismatrix(M)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by