For Loop to read rows on a cell array
2 次查看(过去 30 天)
显示 更早的评论
need help on the following...
key = 'BB';
data = cell(1,24);
data = {'BB'};
for i = size(data);
%compare key to each data on each column
if key = data;
%count number of elements that matches with key
counts = count how many times BB occurs
%number of elements that match divided by size of data
occurrence = counts/side of data
0 个评论
采纳的回答
David Hill
2022-1-25
Not sure if this the correct guess.
y=sum(strcmp(yourCell,'BB'),2)/size(yourCell,2);
5 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!