|
On Oct 14, 2:22 pm, "Ulrik Nash" <u...@sam.sdu.dk> wrote:
> Hello,
>
> I am trying to plot the content of column vectors in matrix A on the same graph. I was hoping the following would work, but only the line for the last vector remains:
>
> for i = numel(A(1,:))
> y = A(1:10,i);
> x = 1:10;
> plot(x,y)
> hold all
> end
>
> What would be a better way to achive my aim?
>
> Regards,
>
> Ulrik.
Simply do the following:
x = 1:10;
A = rand(10,5);
plot(x,A)
As you see this plots five lines, each corresponds to a column of A
Regards,
Diego
|