Matlab find and print coordinates of array values
11 views (last 30 days)
Show older comments
Ilias Thanos
on 26 Jan 2020
Answered: Walter Roberson
on 27 Jan 2020
I have this array:
A =
30 18 40 58 26
70 19 72 29 47
14 48 40 14 48
13 72 59 66 72
I want the program to find the coordinates of the values that are equal or bigger than 42 and then print those answers like this (line,row)
0 Comments
Accepted Answer
Walter Roberson
on 27 Jan 2020
[row, col] = find(A>=42);
fprintf('(%d, %d)\n', [col(:), row(:)].')
0 Comments
More Answers (0)
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!