필터 지우기
필터 지우기

isequal function quary.. Need solution to compare two series.

조회 수: 1 (최근 30일)
Nimisha
Nimisha 2016년 2월 25일
댓글: Nimisha 2016년 2월 26일
result = 1 2 8 7 6 5 4 3 5 5 5 7;
if (isequal(128765435557,result));
a = 'ABC'
else
b = 'XYZ'
end
From one source i am getting some characters as mentioned in "result". All are separated by two spaces. And i want to compare it with pre defined series. But here i am getting error..
if (isequal(1 2 8 7 6 5 4 3 5 5 5 7,result));
|
Error: Unexpected MATLAB expression.
What will be the solution.?

채택된 답변

Walter Roberson
Walter Roberson 2016년 2월 25일
if strcmp('1 2 8 7 6 5 4 3 5 5 5 7',result)
  댓글 수: 3
Andrei Bobrov
Andrei Bobrov 2016년 2월 26일
result = '1 2 8 7 6 5 4 3 5 5 5 7';
if strcmp('1 2 8 7 6 5 4 3 5 5 5 7',result)
a = 'ABC';
else
b = 'XYZ';
end
Nimisha
Nimisha 2016년 2월 26일
Thank You, This working for me..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by