[matlab] I just want to plot a function that describes position as a function of time

  1. Oct 2, 2010 #1
    It's an object that's falling from rest. The equation takes into account linear friction. in any case, this is is my code or program of whatever it is called:

    m=80;%Mass of ignorance
    g=9.8;%Gravity
    beta=1.6*10^-4;%Given coefficient for air at STP
    D=.4;%Diameter of Palin, assuming she's a spherical object
    b=beta*D;%Coefficient of linear friction
    t=0:.2:60;


    x=(m./b)*(g*t + e^(-b*t./m));

    plot(t,x)
    grid on
    xlabel('time','FontSize',16)
    ylabel('Position of Sarah Below Helicopter','FontSize',16)

    I get this error:
    Error in ==> HW13myprogram at 10
    x=(m./b)*(g*t + e^(-b*t./m));

    What am I doing wrong?
     
  2. jcsd
  3. Oct 3, 2010 #2

    Dr Transport

    User Avatar
    Science Advisor
    Gold Member

    Re: [matlab] I just want to plot a function that describes position as a function of

    replace your equation with

    x=(m/b)*(g*t + e.^(-b*t/m));
     
  4. Oct 3, 2010 #3
    Re: [matlab] I just want to plot a function that describes position as a function of

    It worked fine for me with:

    x=(m./b)*(g*t + exp(-b*t./m));
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Similar Discussions: [matlab] I just want to plot a function that describes position as a function of time
Loading...