With a 3D Matrix, How can I plot various 2D lineplots?

I have a 3D matrix, 3x2x100 and I want to plot 6 different lineplots (x-axis would be the 100). The six line plots would be at each value of the (3x2) part of the matrix, and run along the(x100) part of the matrix. How can I do this?

2 件のコメント

Corbin
Corbin 2015 年 10 月 24 日
I thought I could rearrange the matrix to a 6x100 one, is there a useful command for that?
dpb
dpb 2015 年 10 月 24 日
Answer crossed your comment...see below

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

回答 (1 件)

dpb
dpb 2015 年 10 月 24 日
編集済み: dpb 2015 年 10 月 24 日

0 投票

plot(reshape(data,6,[]).')
will be the six in order from 1,1 to 3,2 by column order; iow each of the first column followed by second and third in sequence plotted versus observation number. If you have a given x vector or 100 observations, then use it as normal in plot argument list, of course.
NB: the transpose to turn the rows into columns which is what plot presumes is orientation for different variables.

カテゴリ

ヘルプ センター および File Exchange で Matrix Indexing についてさらに検索

製品

質問済み:

2015 年 10 月 24 日

コメント済み:

dpb
2015 年 10 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by