isempty

5 次查看(过去 30 天)
REN
REN 2011-3-6
Hello, could anyone point out how to check a empty set?
I try isempty, seems wrong
a = [1 3 2]
a =
1 3 2
K>> b = [1 3 2]
b =
1 3 2
K>> d = setdiff(a, b)
d =
Empty matrix: 1-by-0
K>> isempty(d)
ans =
Empty matrix: 1-by-0
  5 个评论
REN
REN 2011-3-6
thanks Matt Tearle
Matt Tearle
Matt Tearle 2011-3-6
OK, never mind then

请先登录,再进行评论。

采纳的回答

Matt Tearle
Matt Tearle 2011-3-6
Problem seems to have been resolved (see above comments), but for the record:
isempty(x)
Another possibility would be
~numel(x)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by