Select rows based on a string in a cell

8 vues (au cours des 30 derniers jours)
BN
BN le 12 Août 2020
Commenté : Star Strider le 12 Août 2020
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

Réponse acceptée

Star Strider
Star Strider le 12 Août 2020
Use strcmpi (the case-insensitive version of the function) instead.
  2 commentaires
BN
BN le 12 Août 2020
Thank you so much
Star Strider
Star Strider le 12 Août 2020
As always, my pleasure!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by