For Loop to read rows on a cell array
조회 수: 1 (최근 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!