Numerical derivative in matlab

803 ビュー (過去 30 日間)
dont panic
dont panic 2013 年 9 月 26 日
回答済み: Tamas Kis 2021 年 4 月 14 日
I'm using Matlab 2012 and would need the numerical derivative of a function. What is the Malab command for that ?
Thank you in advance
  1 件のコメント
Leah 2013 年 9 月 26 日
I like your user name



Azzi Abdelmalek
Azzi Abdelmalek 2013 年 9 月 26 日
If you have a series of data
t=[0 1 2 3 4 5] % Vector time
y=[1 2 4 8 12 13] % Your signal
% The derivative can be approximated :
%You can also use symbolic derivative
syms t y
  1 件のコメント
dont panic
dont panic 2013 年 9 月 26 日
thank you for your reply :) !


その他の回答 (2 件)

Rohit Garud
Rohit Garud 2020 年 8 月 16 日
編集済み: Rohit Garud 2020 年 8 月 16 日
You can use the gradient() function in newer versions of matlab
dy_by_dt = gradient(y(:)) ./ gradient(t(:))
  11 件のコメント
Walter Roberson
Walter Roberson 2021 年 1 月 6 日
for k = 2:length(percent_change)


Tamas Kis
Tamas Kis 2021 年 4 月 14 日
Function that can differentiate a set of points given as vectors (such as how you would use cumtrapz to integrate), or differentiate a function defined using a function handle. It can differentiate at any specified point(s) or over an entire domain. Also is of slightly higher accuracy than using diff(y)./diff(t) because it uses central approximation at the interior nodes.


Community Treasure Hunt

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

Start Hunting!

Translated by