I am getting an error
1 view (last 30 days)
Show older comments
I am getting an error while executing the below for Matlab
Execution of script gradient as function is not supported...can I have urgent help here please
f=@(x) exp(x)-x.^2+5*x;
x=1:0.1:10;
y=f(x);
d=gradient(y,0.1);
%plot(x,d,'o')
0 Comments
Answers (2)
Chunru
on 6 Dec 2021
f=@(x) exp(x)-x.^2+5*x;
x=1:0.1:10;
y=f(x);
d=gradient(y, x);
plot(x,d,'o')
0 Comments
Walter Roberson
on 6 Dec 2021
which gradient
The output will likely show you the name of a file that is not provided by Mathworks. You need to rename or delete that file.
If it does happen to show a file provided by Mathworks such as toolbox/matlab/datafun/gradient.m then you would have a corrupt version of the file and would need to be reinstalled.
See Also
Categories
Find more on Interactive Control and Callbacks in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!