getting string from cell using if statement
13 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
[~,~,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 Commenti
Risposte (1)
Star Strider
il 16 Apr 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 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!