[问题] sfunction的设定问题

楼主: Giliher (阿莫)   2014-04-30 21:51:05
我在基本的设定参数的设定如下
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;
不知道如何解决 请各位帮帮忙 谢谢

Links booklink

Contact Us: admin [ a t ] ucptt.com