Find coordinates

Input a value and a matrix, and this function will output the row(s) and column(s) of the value.
2.5K Downloads
Updated 27 Jul 2005

No License

getcoord(value,matrix)
This function finds the value inside of a matrix containing it. Imput first the value, then the matrix, and the output will be in the form of a vector [r c] with r being the row of the value and c being the column. If the value is present multiple times, the output will be have more rows of [r c]. You can also type in the function in the form getcoord(COORDVAL, MATRIX, RANGEROW, RANGECOL)
where rangerow and rangecol are vectors of integers less than or equal to the dimension of the matrix. This simply finds the value or values in the specified area.

Cite As

Chris Riederer (2024). Find coordinates (https://www.mathworks.com/matlabcentral/fileexchange/8136-find-coordinates), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R13SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Matrices and Arrays in Help Center and MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes
1.0.0.0