I am trying to the row number of '3/8' in a column of text data (52x1) n
1 次查看(过去 30 天)
显示 更早的评论
Tube_data = readtable('Copper Tubes.xls');
Column_1 = Tube_data(1:52,1);
My_Tube_Type = '3/8';
n = 0;
for (i=1:52)
x = Column_1(i,1);
t = strcmp(x,My_Tube_Type);
if t == 1
n = i;
end;
end;
0 个评论
回答(1 个)
DGM
2021-10-27
Tube_data = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/780803/Copper%20Tubes.xls');
Column_1 = Tube_data(1:52,1);
My_Tube_Type = '3/8';
rownum = find(strcmp(table2array(Column_1),My_Tube_Type))
Column_1(rownum,:)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!