How can I plot 2D plot from three matrix?

2 次查看(过去 30 天)
I am trying to plot a 2D plot using three matrices but somehow I couldn't understand. I have three matrices and an array. Suppose,
A =
1 2 3
4 5 4
7 8 9
B =
2 3 13
5 11 10
9 7 6
C =
1 2 3
2 3 13
5 11 10
and an array
Y= [0.001 0.0002 0.0004].
Now I want to plot it in such a way that array values should be on y axis while against 0.001, 0.002 and 0.0004, the matrices value should be arranged. for examples, the
y=0.001, A(1,1)=1,
y=0.0002, B(1,1)=2
y=0.0004, C(1,1)=1
for a single line now similarly same process should go for A(i,j),B(i,j) and c(i,j) points using loop to plot all lines on a single figure.
Thanks

采纳的回答

dpb
dpb 2017-2-20
M=cat(3,A,B,C); % build 3D array of all of individuals to manipulate as one
M=reshape(permute(M,[3,2,1]),3,[]); % rearrange by plane first, row & column and put in columns
plot(y,M) % plot each column against the y vector

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by