How to plot the derivative from experimental data
이전 댓글 표시
Hi I have a number of points (experimental data) plotted as an x-y plot. I want to generate the derivative of y w.r.t x from this plot. Is there a function in MATLAB which can do this ?
TIA
채택된 답변
추가 답변 (1개)
Abhinendra Singh
2017년 11월 27일
0 개 추천
Hello, Can any one of you please post a working example of the above problem?
I appreciate the help!
댓글 수: 3
Sajib Biswas Shuvo
2021년 7월 3일
x = 0:0.1:10;
y = sin(x);
plot(x, gradient(y)./gradient(x));
hold on;
plot(x,y);
legend('dy/dx', 'y');
hold off;

Shahlan Ahmad
2022년 1월 1일
good work
Um, only one call to gradient needed.
x = 0:0.1:10;
y = sin(x);
plot(x, gradient(y,x));
When gradient is called with TWO arguments, it assumes you have passed in x also as the second argument. Now it computes a derivative estimate at each point. A simple finite difference scheme is used.
help gradient
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
