Matlab find and print coordinates of array values

11 views (last 30 days)
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)

Accepted Answer

Walter Roberson
Walter Roberson on 27 Jan 2020
[row, col] = find(A>=42);
fprintf('(%d, %d)\n', [col(:), row(:)].')

More Answers (0)

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!