How to check the variables are equal or not?
조회 수: 2 (최근 30일)
이전 댓글 표시
if a=rt && b=rt
h=h+1;
elseif a~=rt && b=rt
f=f+1;
elseif a=rt && b~=rt
m=m+1;
elseif a~=rt && b~=rt
c=c+1;
end
Is this correct or I wanted to use double equal to '==' to check it
댓글 수: 0
채택된 답변
Stephen23
2018년 6월 25일
You have to use
==
or
isequal
or
strcmp
or
ismember
or any other function that compares variables. = is only for allocation.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Entering Commands에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!