Effacer les filtres
Effacer les filtres

Is it the correct way to extract the value for the logical matrix?

1 vue (au cours des 30 derniers jours)
DulceEien
DulceEien le 16 Août 2021
Modifié(e) : Matt J le 16 Août 2021
I got the following local matrix and now I want to extract the values for the logical 1, but when I do so, I'm getting an error which is
Array indices must be positive integers or logical values.
[X,Y]= meshgrid(T2{:,5},T1{:,5});
A = X(idx);
B = Y(idx);
A = X(idx);
'Array indices must be positive integers or logical values
X and Y has the same size

Réponse acceptée

Matt J
Matt J le 16 Août 2021
Modifié(e) : Matt J le 16 Août 2021
Your screenshot shows that idx is type double, not logical. You can easily convert it, however:
idx=logical(idx);

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by