Select rows based on a string in a cell

조회 수: 7 (최근 30일)
BN
BN 2020년 8월 12일
댓글: Star Strider 2020년 8월 12일
Hello,
I have a 1x19 cell. Each cell looks like this:
I want to store the precip values of WIN in each array. So the output is 1x19 cell with just WIN's precip.
I tried to do it like this:
for i = 1:numel(result_seasonal)
C_WIN{1, i} = result_seasonal{1,i}(strcmp(result_seasonal{1,i}.seasons,'WIN'),:);
end
But it not works and result is 1x19 cell with empty arrays, is there anything that I'm didn't considered?
Thank you all

채택된 답변

Star Strider
Star Strider 2020년 8월 12일
Use strcmpi (the case-insensitive version of the function) instead.
  댓글 수: 2
BN
BN 2020년 8월 12일
Thank you so much
Star Strider
Star Strider 2020년 8월 12일
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by