Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Verticle line

Subject: Verticle line

From: Debkumar

Date: 5 Nov, 2012 03:58:09

Message: 1 of 3

I need a help with a simple plot. I am new in matlab, so any help is much appreciated.
Suppose I have z = [0.9 0.6 0.3 ...]. I want want to draw a plot with a vertical line of length 0.9 at x=1, another vertical line of length 0.6 at x=2 etc. Is there any simple and elegant way of doing this?
 

Subject: Verticle line

From: Nasser M. Abbasi

Date: 5 Nov, 2012 04:07:59

Message: 2 of 3

On 11/4/2012 9:58 PM, Debkumar wrote:
> I need a help with a simple plot. I am new in matlab, so any help is much appreciated.
> Suppose I have z = [0.9 0.6 0.3 ...]. I want want to draw a plot with a vertical line of
>length 0.9 at x=1, another vertical line of length 0.6 at x=2 etc.
>Is there any simple and elegant way of doing this?
>
>
may be

---------------
close all;
z = [0.9 0.6 0.3];
stem(1:length(z),z)
axis([0 length(z)+1 min(z)-1 max(z)+1])
------------------

Subject: Verticle line

From: Debkumar

Date: 5 Nov, 2012 16:27:08

Message: 3 of 3

"Nasser M. Abbasi" <nma@12000.org> wrote in message <k77e2v$9av$1@speranza.aioe.org>...
> On 11/4/2012 9:58 PM, Debkumar wrote:
> > I need a help with a simple plot. I am new in matlab, so any help is much appreciated.
> > Suppose I have z = [0.9 0.6 0.3 ...]. I want want to draw a plot with a vertical line of
> >length 0.9 at x=1, another vertical line of length 0.6 at x=2 etc.
> >Is there any simple and elegant way of doing this?
> >
> >
> may be
>
> ---------------
> close all;
> z = [0.9 0.6 0.3];
> stem(1:length(z),z)
> axis([0 length(z)+1 min(z)-1 max(z)+1])
> ------------------
Thank you. It worked.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us