How to convert matrix indexes to cartesian coordinates
Afficher commentaires plus anciens

Given a matrix a shown above, i want to convert the cell indexes into cartesian coordinates. I am trying to figure out what these indexes represent: is it the center of the cell? or the left corner of the cell? Thanks.
2 commentaires
TADA
le 24 Août 2019
It's both, it's neither... If this is for visualization, I'd prefer the center of the cell But generally its up to you to decide
Tchilabalo
le 25 Août 2019
Réponse acceptée
Plus de réponses (1)
David Hill
le 24 Août 2019
n=3;%nxn matrix
a=1:n^2;
x=floor((a-.1)/n)+1;
y=mod(a,n);
y(find(y==0))=n;
plot(x,y,'LineStyle','none','Marker','o',"Color",'b');
1 commentaire
Tchilabalo
le 25 Août 2019
Catégories
En savoir plus sur Biomedical Imaging dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!