How can I plot matrix locations on top of corresponding matrix elements?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I have a set of 20 matrix locations (elements) which have their subscript indices stored as "xpossav" and "ypossav". These correspond to rows and columns of a matrix, C, respectively. These "coordinates" are simulated location points of a movement trajectory. I want to plot these coordinates on top of the elements in the matrix C that the coordinates correspond to. I know that matrices are indexed (rows, columns), so equivalent plotting would be (y,x). Below is the code I have used to create a plot of the coordinates, so that I can visualize the trajectory:
plot(ypossav,(size(C,1)-xpossav),'-o'),xlabel('X'),ylabel('Y'), title('Trajectory')
This works in plotting the locations correctly. I then want to display the subset of the matrix that corresponds to the locations. For example, the point for location xpossav=1,ypossav=1 should be shown on top of element (1,1) of matrix C. Is there a way to do this? I have tried different approaches, but can only achieve to plot the locations separately from the corresponding matrix subset.
5 Kommentare
dpb
am 21 Jun. 2017
Well, I could read them as .mat files but then not sure precisely what to try to do with them. If they're figures intended to show the way you'd like to present the data, use the 'File' and 'SaveAs' to save them as .jpg then attach the images and we can see them here.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Annotations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!