matlab 分数阶求解

现在我有一堆离散的点i(1),i(2),...i(n)如何求它的分数阶导数

第1个回答  2013-04-12
d=0.1
% r=i(1),i(2),..i(n)
% h=delta t, 2点之间的距离

fderiv(d,r,h)
% This function calculates the fractional derivative of order d for the
% given function r(t). It is assumed that the vector r contains the
% samples of the continuous signal r(t) which we are going to calculate its
% fractional derivative. h is a constant and represents the sampling
% period of r(t) (the time period between two samples). h must be small
% enough in the sense of Nyquist sampling theorem.
% y is the result achieved by applying the fractional differentiation
% operator on the input r. This contains the samples of the real output
% y(t) with the same sampling period used for r.
% It makes use of the Grnwald-Letnikov definition. The first element of
% the vector "r", i.e. r(1), is always zero.
%
% d : the order of fractional differentiation
% r : samples of the signal to be differentiated
% h : sampling poriod

function [y] = fderiv(d,r,h)

temp = 0;
for i=1:length(r)
for j=0:i-1
temp = temp+(-1)^j*(gamma(d+1)/(gamma(j+1)*gamma(d-j+1)))*r(i-j);
end
y(i) = temp;
temp = 0;
end
y = y/(h^d);追问

您的这个算法对 1.5阶的仍然成立么?

追答

这个算法对 1.5阶的仍然成立, d=1.5

追问

如果是整数阶的呢 比如是1阶的 可以成立么

追答

整数阶可以成立,自动计算gamma(n)=n*(n-1)*...*2*1

本回答被提问者采纳
第2个回答  2019-09-27
计算了一阶导数精度对比,这个算法只有一阶精度呀
相似回答