getting string from cell using if statement
17 ビュー (過去 30 日間)
古いコメントを表示
[~,~,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 件のコメント
回答 (1 件)
Star Strider
2018 年 4 月 16 日
The best way to compare strings is to use the strcmp (link) or related functions (linked to at the end of that page).
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!