nfdiff.m
来自「介绍了几个基于EKF扩展卡尔曼滤波的例子」· M 代码 · 共 40 行
M
40 行
function [derivativeValue] = nfdiff(p,point,variables)% nfExampleFunction/nfdiff value of partial derivative of the nonlinear% multivariate function along given parameters in% defined point of state space%% p ... object of the class nfLinFunction% point ... vector value at whitch is the derivative evaluated% variables ... define which partial derivative is demanded% Nonlinear Filtering Toolbox version 2.0rc1% Copyright (c) 1995 - 2006 NFT developement Team,% Department of Cybernetics,% University of West Bohemia in Pilsenif isempty(variables) error('There are no variables specifying the partial derivative');endif length(point)~=p.nvar error('The multivariate value at whitch is the derivative evaluated has incorrect dimension');end% f='[0.96*x1+0.08*x1*x2+w1;1.08*x2-0.08*x1*x2+w2]'% df/dx1 = '[0.96+0.08*x2;-0.08*x2]'% df/dx2 = '[0.08*x1;1.08-0.08*x1]'% df/dw1 = '[1;0]'% df/dw1 = '[0;1]'derivative = [0.96+0.08*point(2), 0.08*point(1), 1, 0;... -0.08*point(2),1.08-0.08*point(1), 0, 1];% look for variable which defines the partial derivative[areVariablesListed,variablesIndex] = ismember(variables,p.parameters);% select columns resulting in partial derivativederivativeValue = derivative(:,[variablesIndex]);% CHANGELOG
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?