Why does strcmp return 0 in in the matlab script while 1 on consol
Show older comments
Hi,
I wonder what mistake I am doing!
When I run the following code on console I get correct output (flag=1) while the same code evaluates to (flag=0) when run in matlab script file. I am trying with Hindi unicode characters. During debug watch I get same values as expected in the variable but evaluation is not as expected. I tried with isequal() function also. but it results same behavior.
-------------
previous='ग';
character='ा';
if strcmp(previous,'ग') && strcmp(character,'ा')
flag=1
else
flag=0
end
-------------------------
Accepted Answer
More Answers (0)
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!