-
大小: 10KB文件類型: .rar金幣: 2下載: 0 次發布日期: 2021-06-10
- 語言: Matlab
- 標簽:
資源簡介
將kalman_filter.m拷貝到MATLAB的根目錄下,用simulink打開kalman_ghx運行即可!

代碼片段和文件信息
function?kalman_filter(block)
%MSFUNTMPL?A?template?for?an?M-file?S-function
%???The?M-file?S-function?is?written?as?a?MATLAB?function?with?the
%???same?name?as?the?S-function.?Replace?‘kalman_filter‘?with?the?name
%???of?your?S-function.??
%
%???It?should?be?noted?that?the?M-file?S-function?is?very?similar
%???to?Level-2?C-Mex?S-functions.?You?should?be?able?to?get?more?
%???information?for?each?of?the?block?methods?by?referring?to?the
%???documentation?for?C-Mex?S-functions.
%??
%???Copyright?2003-2006?The?MathWorks?Inc.
%???$Revision:?1.1.6.13?$??
??
%%
%%?The?setup?method?is?used?to?setup?the?basic?attributes?of?the
%%?S-function?such?as?ports?parameters?etc.?Do?not?add?any?other
%%?calls?to?the?main?body?of?the?function.??
%%???
setup(block);
??
%endfunction
%%?Function:?setup?===================================================
%%?Abstract:
%%???Set?up?the?S-function?block‘s?basic?characteristics?such?as:
%%???-?Input?ports
%%???-?Output?ports
%%???-?Dialog?parameters
%%???-?Options
%%?
%%???Required?????????:?Yes
%%???C-Mex?counterpart:?mdlInitializeSizes
%%
function?setup(block)
??%?Register?number?of?ports
??block.NumInputPorts??=?2;
??block.NumOutputPorts?=?1;
??
??%?Setup?port?properties?to?be?inherited?or?dynamic
??block.SetPreCompInpPortInfoToDynamic;
??block.SetPreCompOutPortInfoToDynamic;
??%?Override?input?port?properties
??block.InputPort(1).DatatypeID??=?0;??%?double
??block.InputPort(1).Complexity??=?‘Real‘;
??block.InputPort(2).DatatypeID??=?0;??%?double
??block.InputPort(2).Complexity??=?‘Real‘;
??
??%?Override?output?port?properties
??block.OutputPort(1).DatatypeID??=?0;?%?double
??block.OutputPort(1).Complexity??=?‘Real‘;
??%?Register?parameters
??block.NumDialogPrms?????=?0;
??%block.DialogPrmsTunable?=?{‘Tunable‘‘Nontunable‘‘SimOnlyTunable‘};
??%?Register?sample?times
??%??[0?offset]????????????:?Continuous?sample?time
??%??[positive_num?offset]?:?Discrete?sample?time
??%
??%??[-1?0]???????????????:?Inherited?sample?time
??%??[-2?0]???????????????:?Variable?sample?time
??block.SampleTimes?=?[0?0];
??
??%%?-----------------------------------------------------------------
??%%?Options
??%%?-----------------------------------------------------------------
??%?Specify?if?Accelerator?should?use?TLC?or?call?back?into?
??%?M-file
??block.SetAccelRunOnTLC(false);
??
??%%?-----------------------------------------------------------------
??%%?The?M-file?S-function?uses?an?internal?registry?for?all
??%%?block?methods.?You?should?register?all?relevant?methods
??%%?(optional?and?required)?as?illustrated?below.?You?may?choose
??%%?any?suitable?name?for?the?methods?and?implement?these?methods
??%%?as?local?functions?within?the?same?file.
??%%?-----------------------------------------------------------------
????
??%%?-----------------------------------------------------------------
??%%?Register?methods?called?during?update?diagram/compilation
??%%?-----------------------------------------------------------------
??
??%%?
??%
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????12006??2009-05-19?14:24??基于Simuli
?????文件??????23351??2009-05-25?23:51??基于Simuli
?????文件?????????70??2009-08-02?21:07??基于Simuli
?????目錄??????????0??2009-08-02?21:06??基于Simuli
-----------?---------??----------?-----??----
????????????????35427????????????????????4
- 上一篇:Itti經典的視覺顯著性檢測代碼
- 下一篇:通信原理課程設計 擴頻通信
評論
共有 條評論