Path: news.mathworks.com!not-for-mail
From: "Ulrik Nash" <uwn@sam.sdu.dk>
Newsgroups: comp.soft-sys.matlab
Subject: Re: plotting with LineSpec contained in vector
Date: Tue, 18 Oct 2011 03:22:26 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 36
Message-ID: <j7irdi$pd3$1@newscl01ah.mathworks.com>
References: <j7icip$cv7$1@newscl01ah.mathworks.com> <6a15844c-7180-47a7-aed8-d1485a0d5f86@g27g2000pro.googlegroups.com>
Reply-To: "Ulrik Nash" <uwn@sam.sdu.dk>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1318908146 26019 172.30.248.47 (18 Oct 2011 03:22:26 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 18 Oct 2011 03:22:26 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2106050
Xref: news.mathworks.com comp.soft-sys.matlab:746356

"Parag S. Chandakkar" <parag2489@gmail.com> wrote in message <6a15844c-7180-47a7-aed8-d1485a0d5f86@g27g2000pro.googlegroups.com>...
> On Oct 17, 4:09 pm, "Ulrik Nash" <u...@sam.sdu.dk> wrote:
> > Why won't the following trick work for line specification?
> >
> > t = 1:timeperiods;
> > line_colour = [0 0 0; 0 0 0; 0 0 0]
> > line_thickness = [1; 1; 1]
> > line_style = char('-','--',':')
> > for i = 1:num_files
> > plot(t,A(num_lables + 1:timeperiods + num_lables,i),'Color',line_colour(i,:),'LineWidth',line_thickness(i,:),'Lin eSpec',line_style(i,:))
> > hold all
> > plot(t,B(num_lables + 1:timeperiods + num_lables,i),'Color',line_colour(i,:),'LineWidth',line_thickness(i,:),'Lin eSpec',line_style(i,:))
> > end
> 
> This works in a similar fashion... there are some errors of index
> exceed... but that should be fine... A and B are 5x5 matrices I have
> defined.
> 
> t = 1:3;
> line_colour = [0 0 0; 0 0 0; 0 0 0]
> line_thickness = [1; 1; 1]
> line_style = {'-r*','--mo',':bs'};
> for i = 1:3
> plot(t,A(2:1+timeperiods,i),line_style{i})
> hold all
> plot(t,B(2:1+timeperiods,i,i),line_style{i});
> end
> 
> Hope this helps.
> Regards,
> -Parag S. Chandakkar.


Thank you Parag, but it doesn\t appear to work as intended. The colours in the line_colour vector and the line thickness of in line_thickness vector now do not appear to be incorporated.

Any other ideas?