![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174842/image.png)
How to plot two n*n matrices in same plot?
10 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Amin Gan
el 8 de Ag. de 2016
I have two N1*N1 and N2*N2 matrices (both are same size 5000*5000).
Need to plot each column of N1 with each column of N2 ( N1(:,1),N2(:,1) && N1(:,2),N2(:,2).... for example ).
I used this code below but doesnt work
for n=1:5000
plot(N1(:,n),N2(:,n))
end
can you please advise?
0 comentarios
Respuesta aceptada
Stephen23
el 8 de Ag. de 2016
Editada: Stephen23
el 8 de Ag. de 2016
You start by reading the plot documentation, which tells you that if both X and Y are matrices of the same size, then "The plot function plots columns of Y versus columns of X."
We love reading the documentation, because it tell us all how to use MATLAB.
>> X = [1,2,3;2,3,4;4,5,6]'
X =
1 2 4
2 3 5
3 4 6
>> Y = [1,0,2;1,2,3;2,1,2]'
Y =
1 1 2
0 2 1
2 3 2
>> plot(X,Y)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174842/image.png)
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Annotations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!