How to get the XY of an imagesc rather than the rows and columns
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Daniel Green
le 24 Juil 2017
Modifié(e) : Daniel Green
le 9 Août 2017
I'm having trouble thinking of a way to retrieve the X and Y of my "imagesc" rather than the rows and columns. By using the code:
[value,location] = max(xyplane(:))
[R,C] = ind2sub(size(xyplane),location)
R and C return the rows and columns of the maximum I'm looking for. However, I want the X and Y, like I have displayed in the picture below.
I have used my own linspace to create my axes at this size.
0 commentaires
Réponse acceptée
Image Analyst
le 24 Juil 2017
Modifié(e) : Image Analyst
le 24 Juil 2017
Try this:
maxValue = max(xyplane(:))
[rows, columns] = find(xyplane == maxValue);
% If you'd rather them be named x and y:
[y, x] = find(xyplane == maxValue);
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Data Exploration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!