Why does strcmp return 0 in in the matlab script while 1 on consol
显示 更早的评论
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
-------------------------
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!