How do I get values of a certain parameter in a multi-dimensional matrix?
1 次查看(过去 30 天)
显示 更早的评论
A is a variable with the size of 1000 x 500.
% Index of those that are less than 10000
Ind = A < 10000;
Why does the below give me a 500000 x 1 column data, instead of a 1000 x 500 matrix?
b = a(Ind);
What did I do wrong? How do I get the correct b with the size of 1000 x 500?
0 个评论
采纳的回答
更多回答(1 个)
Matt J
2021-11-30
b should be an Nx1 vector where N is the number of elements satisfying A<10000.
6 个评论
Steven Lord
2021-11-30
You could also use standardizeMissing.
M = 9e26;
format shortg
A = [4 8 M 15 M M; 16 23 42 M M M]
B = standardizeMissing(A, M)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!