Results 1 to 2 of 2

Math Help - plotting many functions on one graph in matlab

  1. #1
    Member
    Joined
    Sep 2009
    Posts
    242
    Thanks
    1

    plotting many functions on one graph in matlab

    Hello,

    I need to plot many functions in the same figure in matlab. Can't figure it out. I am not talking about "sublot". I mean multiple functions overlaid on the same graph.

    For eg. below I want to plot the functions "f" and "v" on top of each other:

    figure(1)
    v=inline('1/x','x');
    f=inline('1/2*(tanh(log(x))+1)','x');
    xmin=0; xmax=5;
    fplot(f,[xmin xmax])
    fplot(v,[xmin xmax])


    Thanks
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Senior Member BAdhi's Avatar
    Joined
    Oct 2010
    From
    Gampaha, Sri Lanka
    Posts
    252
    Thanks
    6

    use "hold on;"

    Quote Originally Posted by rainer View Post

    figure(1)
    v=inline('1/x','x');
    f=inline('1/2*(tanh(log(x))+1)','x');
    xmin=0; xmax=5;
    fplot(f,[xmin xmax])
    fplot(v,[xmin xmax])
    try entering "hold on;" statement in between "fplot(f,[xmin xmax])" and "fplot(v,[xmin xmax])"
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. matlab plotting graph need help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: August 6th 2010, 11:27 PM
  2. Replies: 1
    Last Post: May 8th 2010, 10:10 PM
  3. plotting a graph in matlab
    Posted in the Math Software Forum
    Replies: 3
    Last Post: March 21st 2009, 02:11 PM
  4. Matlab - Plotting Circles
    Posted in the Math Software Forum
    Replies: 1
    Last Post: February 16th 2009, 08:28 AM
  5. MATLAB - plotting a quadratic
    Posted in the Math Software Forum
    Replies: 2
    Last Post: June 15th 2008, 05:25 PM

Search Tags


/mathhelpforum @mathhelpforum