The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: plotting many functions on the same screen
Replies: 2   Last Post: Jun 2, 2011 4:30 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Jim Rockford

Posts: 164
Registered: 6/30/06
Re: plotting many functions on the same screen
Posted: Jun 2, 2011 3:38 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On Jun 2, 3:20 pm, "Mohammad " <> wrote:
> for i=1:5
>     t=linspace(0,2*pi,100);
>     x= ellipseperpoint(i,1)+ellipseperpoint(i,4)*cos(t-ellipseperpoint(i,3));
>     y= ellipseperpoint(i,2)+ellipseperpoint(i,5)*sin(t-ellipseperpoint(i,3));
>     plot(x,y);
> end
> I have 5 parametrix functions of x and y that I want to plot on the same screen. My current loop replaces each previous function such that only the last parametric equation lasts. Is there an easy way to avaoid this without hardwiring all five equations on the screen.
> Thanks!
> Cordially, Mohammad

Right before the "end" statement put "if i == 1, hold on; end"

Read the documentation on "hold"


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.