comparing strings
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 22 Gen 2012
Yes? And why does that require comparing as strings instead of as numeric values?
Risposte (1)
Walter Roberson
il 23 Gen 2012
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 Commenti
Vedere anche
Categorie
Scopri di più su String Parsing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!