comparing strings
5 ビュー (過去 30 日間)
古いコメントを表示
i have set of values,
A=[1:1:80]
B=1
now i want to convert into strings and then compare,if the values are same it should display 1 else 0
5 件のコメント
Walter Roberson
2012 年 1 月 22 日
Yes? And why does that require comparing as strings instead of as numeric values?
回答 (1 件)
Walter Roberson
2012 年 1 月 23 日
for K = 1 : length(A)
results(K) = 0 + strcmp(num2str(A(K)), num2str(B));
end
I still think this is not good programming practice, but you asked and here it is.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で String Parsing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!