how to calculate a derivative
이전 댓글 표시
can some one guide me how to calculate a derivative and integration in matlab . can you please give a little example.
채택된 답변
추가 답변 (3개)
Magdalena Glinska
2020년 11월 16일
f = @(x) sin(x);
second_derivative_f = matlabFunction(diff(sym(f)));
Hamza saeed khan
2020년 11월 24일
syms x
f = x;
diff(f,x)
why this code give me error as;
>>Error in diff (line 1)
syms x
댓글 수: 4
Dheeresh agarwal
2020년 12월 22일
diff(f,1)
Walter Roberson
2020년 12월 22일
You probably do not have the symbolic toolbox installed or licensed.
Also, you accidentally named your script diff.m which is going to conflict with calling diff() to differentiate.
belvia
2025년 5월 12일
même chez moi le diff là ne donne pas
Steven Lord
2025년 5월 12일
"même chez moi le diff là ne donne pas"
Please show us the exact code you're running and all the text displayed in red in the Command Window (and if there are any warning messages displayed in orange, please show us those too) that you see when you run that code. The exact text may be useful and/or necessary to determine what's going on and how to avoid the warning and/or error.
Achimsettythanmay
2022년 11월 14일
편집: Walter Roberson
2022년 11월 15일
syms x real
f = 1/x
int(f,1,2) % integration
diff(f) %differentiation
카테고리
도움말 센터 및 File Exchange에서 Special Values에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!