필터 지우기
필터 지우기

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