[問題] sfunction的設定問題

看板MATLAB作者 (阿莫)時間11年前 (2014/04/30 21:51), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/1
我在基本的設定參數的設定如下 function [sys,x0,str,ts] = plant(t,x,u,flag,functionN) %CSFUNC An example M-file S-function for defining a continuous system. % Example M-file S-function implementing continuous equations: % x' = Ax + Bu % y = Cx + Du % % See sfuntmpl.m for a general S-function template. % % See also SFUNTMPL. % Copyright 1990-2001 The MathWorks, Inc. % $Revision: 1.8 $ vcc=24; R=1.452826565; L=0.001282283; ke=0.035606324; kt=0.028228647; kf=0.000016585; J=0.000152052; A0=[-R/L 0;0 -kf/J]; A1=[0 -ke/(2*L);kt/J 0]; B=[1/(2*L);0]; C=[0 1]; D=[0]; A=A0+A1*functionN; switch flag functionN是一個時變的參數,然後simulink model如圖 http://imgur.com/JJNthQh
可是這樣我在執行的時候程式碼的時候,就會出現 ??? Input argument "functionN" is undefined. Error in ==> plant at 28 A=A0+A1*functionN; 不知道如何解決 請各位幫幫忙 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.120.90.230 ※ 文章網址: http://www.ptt.cc/bbs/MATLAB/M.1398865867.A.133.html
文章代碼(AID): #1JOF_B4p (MATLAB)
文章代碼(AID): #1JOF_B4p (MATLAB)