linear index to matrix index
Show older comments
ola,
I have a matrix 1020x1294, and the linear index 475000. I can do the math by myself, but I'd like to know is there a function that calculates what is the row&column of this index in the matrix?
thanks
Accepted Answer
More Answers (1)
One approach:(use ind2sub)
A=randi([1 5],1020,1294);%demo data
[r,c]=ind2sub(size(A),475000)
1 Comment
Andrei Bobrov
on 1 Feb 2018
+1
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!