getting string from cell using if statement
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
[~,~,raw] = xlsread('StudentData_20students.xlsx');
header = raw(1,:);
data = raw(2:end,:);
x = data(:,3)
for q = 1:20
n = x(q,1)
if n == 'ON'
b = 'TRUE'
end
end
0 commentaires
Réponses (1)
Star Strider
le 16 Avr 2018
The best way to compare strings is to use the strcmp (link) or related functions (linked to at the end of that page).
0 commentaires
Voir également
Catégories
En savoir plus sur String Parsing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!