how to take a row and column of a value and add it to an array

2 次查看(过去 30 天)
I currently have code that stores a bunch of values in an array
I then create a logical array such as B = A < 20
Then i create an array that shows the values in A that are less than 20 C = A(B)
Now my question is, how do I also add row and column numbers to the C array with their corresponding values that are less than 20.
thank you

回答(1 个)

David Hill
David Hill 2019-12-14
[a,b]=find(A<20);
B=A(A<20)+a+b;

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

产品


版本

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by