Question

3) Develop a Matlab function to compute the velocity v of a particular projectile as a function of time t. In this problem, t
at each time value, one value of time at a time, for the following specific values of the 11 parameters (which you will then
0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • clc
    clear all
    close all
    a=10;
    b=5;
    c=624;
    d=3;
    g=36;
    h=12;
    k=16;
    m=2136;
    n=0.1;
    p=26;
    q=0;
    user=[a,b,c,d,g,h,k,m,n,p,q];
    t=-5:0.01:50;
    v=[];
    for i=1:length(t)
    v(i)=vfunc(t(i),user);
    end
    plot(t,v);
    xlabel('Time');
    ylabel('v(t)');
    title('Plot of v(t)');
    function v=vfunc(t,user)
    a=user(1);
    b=user(2);
    c=user(3);
    d=user(4);
    g=user(5);
    h=user(6);
    k=user(7);
    m=user(8);
    n=user(9);
    p=user(10);
    q=user(11);
    v=0;
    if(t>=0&&t<=8)
    v=a*t^2-b*t;
    elseif(t>=8&&t<=16)
    v=c-d*t;
    elseif(t>=16&&t<=26)
    v=g*t+h*(t-k)^2;
    elseif(t>26)
    v=m*exp(-n*(t-p));
    else
    v=q;
    end
      
    end

Add a comment
Know the answer?
Add Answer to:
3) Develop a Matlab function to compute the velocity v of a particular projectile as a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Questions a) Write a (Matlab) function, which accepts the following inputs: -the finite set of Fo...

    Questions a) Write a (Matlab) function, which accepts the following inputs: -the finite set of Fourier series coefficients a-N, a-N+1,.. , a-1, ao, a1, aN-1, aN the fundamental period T of the signal to be reconstructed a vector t representing the times for which the signal will be constructed - and produces as output xv(t) (i.e., the output of the (Matlab) function should be a vector x of length equal to the length of t containing the values of xN...

  • USE MATLAB TO SOLVE PLEASE 42. The velocity, v, of an object that falls freely due...

    USE MATLAB TO SOLVE PLEASE 42. The velocity, v, of an object that falls freely due to the Earth gravity can be modeled with the equation: - mg + kv? dt where m is the mass of the object, g = 9.81 m/s2, and k is a constant. Solve the equation for v for the case that m = 5 kg, k = 0.05 kg/m, 0<t<15 s, and wo) = 0 m/s. Make a plot of v as a function...

  • Develop a MATLAB function that will compute the following function. Test your function for t =...

    Develop a MATLAB function that will compute the following function. Test your function for t = 7, 15, 25 and 100. Include your m file and the output of your tests in the word file. Plot this function in the range of t = 0 to 30. Include your plot with your submission. v(t)= 10t^2-5t 0<= t <=8   624-5t 8<= t <=16 36t + 12(t-16)^2 16<= t <=26 2136e^-0.1(t-26) t > 26 0 otherwise   

  • MATLAB MATLAB MATLAB Model description The logistic map is a function that is often used to...

    MATLAB MATLAB MATLAB Model description The logistic map is a function that is often used to model population growth. It is defined by P(t+1) = rP(t) (1 -P(t)/K) Here, P(t) represents the density of a population at year 1, the parameter r is a growth rate and the parameter K is the maximum possible population density (known as the carrying capacity). This equation says that if we know the density at one year, we can substitute it into the right-hand...

  • P2) Write a MATLAB function myLinReg Username that is defined below. Use the in-built MATLAB func...

    P2) Write a MATLAB function myLinReg Username that is defined below. Use the in-built MATLAB function sum( ) to ease your programming (you are NOT allowed to use polyfit() and polyval()). Test the output of this function with the results obtained by hand for P1. Submit printout of program and a screenshot of the command window showing the results for P1. function [coeffvec, r2]-myLinReg_Username (xi,yi) %Function file: myLinReg-Username .m Purpose : 8 To obtain the parameters of a L.S. linear...

  • MATLAB Write a user defined function for a projectile motion. If a ball is launched from...

    MATLAB Write a user defined function for a projectile motion. If a ball is launched from initial position(0,0) with a velocity v0 at angle θ, determine your horizontal and vertical position. Please plot x vs. t, y vs. t and y vs. x.

  • 1. For the function (t) below, T 2 and Vm-100 V. vt) 3 2 012 3...

    1. For the function (t) below, T 2 and Vm-100 V. vt) 3 2 012 3 (a) Sketch v'(t) and derive the Fourier coefficients for '(t). (b) Use your results from part (a) to determine for Fourier coefficients for v(t). Express your solution in the complex form of the Fourier series, nugt and verify your solution by plotting your results using Matlab. 2. Assume that the signal above is the input to the bandpass filter shown below. y (t (a)...

  • 1) Create a matlab function that calculates: for Name your function TwoVarFunc : The inputs should...

    1) Create a matlab function that calculates: for Name your function TwoVarFunc : The inputs should be in the same order: xmin xmax ymin ymax N: n is the number of elements in the vector x and y The ouputs should be in the same order: f_xy: is the calculated array f(x,y) f_xyMAX: should be the the maximum value of the function f(x,y). Hint: to create vectors x and y look up the matlab built-in function linspace() Hint 2: To...

  • Problem 6 Implement a MATLAB function bisection.m of the form bisection(a, b, f, p, t) function...

    Problem 6 Implement a MATLAB function bisection.m of the form bisection(a, b, f, p, t) function [r, h] % a Beginning of interval [a, bl % b: End of interval [a, b] % f: function handle y f(x, p) % p: parameters to pass through to f % t: User-provided tolerance for interval width At each step j 1 to n, carefully choose m as in bisection with the geometric (watch out for zeroes!) Replace [a, b] by the smallest...

  • Please solve using MATLAB. Write a MATLAB function to compute and plot the output of the...

    Please solve using MATLAB. Write a MATLAB function to compute and plot the output of the discrete-time system for x[n]-u[n], 0 < n < 1000. Based on these results can you make a statement regarding the stability of the system? Hint: Check the value y[600]

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT