フィルターのクリア

How can I plot matrix locations on top of corresponding matrix elements?

1 回表示 (過去 30 日間)
Stephanie Diaz
Stephanie Diaz 2017 年 6 月 21 日
コメント済み: Stephanie Diaz 2017 年 6 月 22 日
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 件のコメント
dpb
dpb 2017 年 6 月 21 日
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.
Stephanie Diaz
Stephanie Diaz 2017 年 6 月 22 日
Hi @dpb ,
I have attached them as image files. The "points3" files are the coordinates, the "matrix subset2" files is the part of the larger matrix that these points correspond to, and "matrix_C2" is the larger matrix. "Plot" is more of what I would like the plotting to look like, basically points overlaid on their location on a map. My map is essentially the matrix subset.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by