getting string from cell using if statement
18 次查看(过去 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!