필터 지우기
필터 지우기

I am getting an error

조회 수: 1 (최근 30일)
Ramesh Rajagopal
Ramesh Rajagopal 2021년 12월 6일
댓글: Ramesh Rajagopal 2021년 12월 6일
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')

답변 (2개)

Chunru
Chunru 2021년 12월 6일
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 2021년 12월 6일
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
Ramesh Rajagopal
Ramesh Rajagopal 2021년 12월 6일
Thank you...the issue was with the filename being gradient....I have renamed it and it works....thnks for the help

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by