if clause for a nonscalar operator
    조회 수: 3 (최근 30일)
  
       이전 댓글 표시
    
Hi everyone
I have this code:
p=[];
if p==[]
    disp('hello')
else 
    disp('bye')
end
and I expect this answer:
>> test
hello
but I receive this answer:
>> test
bye
how can i solve this problem???
댓글 수: 0
채택된 답변
  Abderrahim. B
      
 2022년 8월 2일
        If I understood correctly:
p=[];
if ~isscalar(p)
    disp('hello')
else 
    disp('bye')
end
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

