Borrar filtros
Borrar filtros

I am getting an error

1 visualización (últimos 30 días)
Ramesh Rajagopal
Ramesh Rajagopal el 6 de Dic. de 2021
Comentada: Ramesh Rajagopal el 6 de Dic. de 2021
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')

Respuestas (2)

Chunru
Chunru el 6 de Dic. de 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')

Walter Roberson
Walter Roberson el 6 de Dic. de 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.
  1 comentario
Ramesh Rajagopal
Ramesh Rajagopal el 6 de Dic. de 2021
Thank you...the issue was with the filename being gradient....I have renamed it and it works....thnks for the help

Iniciar sesión para comentar.

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by