Plotting a 3D matrix over time

7 ビュー (過去 30 日間)
Leslie Chase
Leslie Chase 2018 年 12 月 3 日
コメント済み: nivedha baskar 2019 年 7 月 19 日
I am calculating 3x3 matrices over time. For every new t, there is a new matrix. I then calculate the euclidean distance between the new matrix and the original matrix each time. I want to represent the distance between the matrices over time, but I can't figure out how to graph a 3x3 matrix over time since that would be 4 dimensions. I want to find a way to just make this a 2d graph, distance vs time, but the distance is obviously a 3x3 value. Any ideas for how I can represent this data on a graph?
  1 件のコメント
nivedha baskar
nivedha baskar 2019 年 7 月 19 日
could you please share the code

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

回答 (1 件)

Matt J
Matt J 2018 年 12 月 3 日
編集済み: Matt J 2018 年 12 月 3 日
If your final data set is a 3x3xN array, D, you can reshape and plot it as follows
plot( reshape(D,9,N).' )
This will display each time path D(i,j,:), i=1,2,3, j=1,2,3 as its own curve.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by