isempty

7 ビュー (過去 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 Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by