フィルターのクリア

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 Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by