Thread Subject: plotting a 2D graph

Subject: plotting a 2D graph

From: kotoko san

Date: 20 May, 2008 21:23:03

Message: 1 of 3

Hi

  I'm trying to find a way to plot a 2D graph. The problem
is that for y I wanted T = T * t.
  I don't know if I explained myself right. The idea is to
have 0:0.001:0.5 for x and for each number to have the
result of T = T * t.
  For example for a starting T and t of 0.5 we would have
    x = 0 , y = 0.25
    x = 0.001 , y = 0.125
    x = 0.002 , y = 0.0625
  and so on . . .

 I've done the following m file:

T = 0.5
t = 0.999
T = T * t;
x = 0:0.001:0.5;
plot ( x , T );

  but all I get in the graph is a series of dots ( I assum
to be x )

   What am I missing?
   Thanks in advance.
 

Subject: plotting a 2D graph

From: Matt

Date: 21 May, 2008 20:10:22

Message: 2 of 3

"kotoko san" <kotoko.san@gmail.com> wrote in message
<g0vffn$6ol$1@fred.mathworks.com>...
> Hi
>
> I'm trying to find a way to plot a 2D graph. The
problem
> is that for y I wanted T = T * t.
> I don't know if I explained myself right. The idea is
to
> have 0:0.001:0.5 for x and for each number to have the
> result of T = T * t.
> For example for a starting T and t of 0.5 we would have
> x = 0 , y = 0.25
> x = 0.001 , y = 0.125
> x = 0.002 , y = 0.0625
> and so on . . .
>
> I've done the following m file:
>
> T = 0.5
> t = 0.999
> T = T * t;
> x = 0:0.001:0.5;
> plot ( x , T );
>
> but all I get in the graph is a series of dots ( I
assum
> to be x )
>
> What am I missing?
> Thanks in advance.
>


Based on what I see here, you're plotting a vector, x, with
a scalar, T*t. You need to vary T with x.

Subject: plotting a 2D graph

From: Matt Fig

Date: 21 May, 2008 21:52:02

Message: 3 of 3

How about this?

x = 0:.001:.5;
T = .5;
t = .999;
y = T * t.^(1:length(x));
plot(x,y)

Is that what you wanted?

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com