- #1
Firben
- 145
- 0
Write a user-defined MATLAB function for the following math function:
y(t) = -0.2x^4 + e^(-0.5x)*x^3+7x^2
The input to the function is x and the output is y. Write the function such that x can be a vector
Use this function to make a plot of the function y(x) -3≤x≤4
function y=chp7one(x)
y=-0.2*x.^4+exp(-0.5*x)*x.^3 + 7*x.^2;
x=[-3 -2 -1 0 1 2 3 4];
plot(x,y);
Error in ==> chp7one at 2
y=-0.2*x.^4+exp(-0.5*x)*x.^3 + 7*x.^2;
y(t) = -0.2x^4 + e^(-0.5x)*x^3+7x^2
The input to the function is x and the output is y. Write the function such that x can be a vector
Use this function to make a plot of the function y(x) -3≤x≤4
function y=chp7one(x)
y=-0.2*x.^4+exp(-0.5*x)*x.^3 + 7*x.^2;
x=[-3 -2 -1 0 1 2 3 4];
plot(x,y);
Error in ==> chp7one at 2
y=-0.2*x.^4+exp(-0.5*x)*x.^3 + 7*x.^2;
Last edited: