Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
Nimisha
Nimisha am 25 Feb. 2016
Kommentiert: Nimisha am 26 Feb. 2016
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.?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 25 Feb. 2016
if strcmp('1 2 8 7 6 5 4 3 5 5 5 7',result)
  3 Kommentare
Andrei Bobrov
Andrei Bobrov am 26 Feb. 2016
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 am 26 Feb. 2016
Thank You, This working for me..

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by