Answer:
Go to explaination for the step by step answer.
Explanation:
a)Code
function[y]=operation(x) % this function takes x as input and returns y as output
y=(-0.2*x^3+7*x^2)*exp(-0.3*x)
end
% call this function in command widow by typing operation(value of x) like shown in figure in the first attachment.
b. write a code of above function in one script window and save the code with same name as name of function that is name of script should be saved as operation.Now copy paste the below code in new script window and run the code
clc
clear all
x=-2:.1:6
n=length(x)
for i=1:1:n
a=x(i)
y(i)=operation(a)
end
plot(y,x)
xlabel('X')
ylabel('Y')
Please kindly check attachment for pictorial answers that supports the code.