rahul.6sept
Full Member level 5
- Joined
- Nov 17, 2006
- Messages
- 243
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,298
- Location
- Guwahati, India
- Activity points
- 2,889
Dear all,
Kindly advice me the correction for this code of matlab.I'm not able to get the output. Also I don't know how to compare the outputs in array to find the max and min.
Regards,
Rahul
Kindly advice me the correction for this code of matlab.I'm not able to get the output. Also I don't know how to compare the outputs in array to find the max and min.
Code:
%For x=[0:0.1:1], calculate f(x)=xe^-2x. Report the value of x at which
%f(x) is maximum. This value of x should be reported in variable "result"
x=[0:0.1:1];
fx=[];
while (x>=1)
fx=x*exp(-2*x);
disp (['the value of fx is = ', num2str(fx)]);
end
Regards,
Rahul
Last edited by a moderator: