"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <j7f0j3$3jc$1@newscl01ah.mathworks.com>...
> "salman " <salmanabdullah9@gmail.com> wrote in message <j7e0dm$26s$1@newscl01ah.mathworks.com>...
> > "Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <j7dm5k$35k$1@newscl01ah.mathworks.com>...
> > > Hi Everyone,
> > >
> > > Suppose I have the following code, which plots different lines on a graph:
> > >
> > > t = 1:timeperiods;
> > > for i = 1:num_files
> > > plot(t,A(1:timeperiods,i))
> > > hold all
> > > plot(t,B(1:timeperiods,i))
> > > end
> > >
> > > For each loop (i.e. for each pair of lines) I wish to change the colour of lines. How can I amend the code to do this?
> > >
> > > Regards,
> > >
> > > Ulrik.
> > for m=1:x
> > hold on
> > plot(t,y(m),'Color',rand(1,3)))
> > end
>
>
> I am sorry, but could you please answer within the context of my code?
t = 1:timeperiods;
> > > for i = 1:num_files
hold on
> > > subplot(211)
plot(t,A(1:timeperiods,i),'Color',rand(1,3))
subplot(212)
> > > > > > plot(t,B(1:timeperiods,i),'Color',rand(1,3))
> > > end
you might see it separate on two subplots
i think this should do :)
