Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19

Math Help - m file failure?

  1. #16
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by ramdrop View Post
    I got a very nice plot, thanks, so I guess I do the same for the next part of the file?
    As it happens you don't need to, at the command prompt now type:

    Code:
    >>plot(x,(f(x+0.1)-f(x))/0.1,'r')
    >>plot(x,(f(x+0.01)-f(x))/0.01,'g')
    >>plot(x,(f(x+0.001)-f(x))/0.001,'b')
    >>plot(x,(f(x+0.0001)-f(x))/0.0001,'m')
    If you want them on the same plot you will need

    Code:
    >>hold on
    before hand, (and sort out axes)

    CB
    Follow Math Help Forum on Facebook and Google+

  2. #17
    Junior Member
    Joined
    Apr 2010
    Posts
    59
    But what about the derivative? Im trying to differentiate the function, maybe its not being shown as well because the original is e^x

    If it was for say, x^2:

    function [y]=f(x)
    y=exp(x);

    then...

    >>x=[-10:0.5:10]
    >>y=f(x)
    >>plot(x,y);
    then, i want to plot the derivative, and approximate it... using the values of x = 0.01, 0.001.. .etc, so the fd(x) is needed.
    Follow Math Help Forum on Facebook and Google+

  3. #18
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by ramdrop View Post
    But what about the derivative? Im trying to differentiate the function, maybe its not being shown as well because the original is e^x

    If it was for say, x^2:




    then...



    then, i want to plot the derivative, and approximate it... using the values of x = 0.01, 0.001.. .etc, so the fd(x) is needed.
    Reread my last post

    CB
    Follow Math Help Forum on Facebook and Google+

  4. #19
    Junior Member
    Joined
    Apr 2010
    Posts
    59
    Thats my fault lol :P I under quite a bit of pressure today :f

    But thanks, it works just like i wanted it too.

    With the titles + axis labels, i just type them @ command promt or place them in the f file?
    Follow Math Help Forum on Facebook and Google+

Page 2 of 2 FirstFirst 12

Similar Math Help Forum Discussions

  1. failure time
    Posted in the Advanced Statistics Forum
    Replies: 3
    Last Post: June 11th 2010, 03:23 AM
  2. Probabilty of failure
    Posted in the Statistics Forum
    Replies: 1
    Last Post: February 23rd 2010, 05:57 PM
  3. Assume that the time of failure..
    Posted in the Advanced Statistics Forum
    Replies: 6
    Last Post: January 1st 2010, 09:23 PM
  4. Mat lab - Referencing M-file in another M-file
    Posted in the Math Software Forum
    Replies: 5
    Last Post: December 16th 2009, 02:53 AM
  5. Variation of the Failure Rate
    Posted in the Advanced Statistics Forum
    Replies: 0
    Last Post: November 1st 2009, 03:43 AM

Search Tags


/mathhelpforum @mathhelpforum