nfdiff.m

来自「介绍了几个基于EKF扩展卡尔曼滤波的例子」· M 代码 · 共 39 行

M
39
字号
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 nfExampleFunction% 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='[x1*x2+w1;x2+w2]'% df/dx1 = '[x2;0]'% df/dx2 = '[x1;1]'% df/dw1 = '[1;0]'% df/dw1 = '[0;1]'derivative = [point(2) point(1) 1 0;0 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 + -
显示快捷键?