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

5 ビュー (過去 30 日間)
DulceEien
DulceEien 2021 年 8 月 16 日
編集済み: Matt J 2021 年 8 月 16 日
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

採用された回答

Matt J
Matt J 2021 年 8 月 16 日
編集済み: Matt J 2021 年 8 月 16 日
Your screenshot shows that idx is type double, not logical. You can easily convert it, however:
idx=logical(idx);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by