我是靠谱客的博主 酷酷歌曲,这篇文章主要介绍matlab中的myerr,Error in 'MPC1/S-Function' while executing MATLAB S-function 'MY_MPCCon...,现在分享给大家,希望可以做个参考。
function[sys,x0,str,ts]=MY_MPCController(t,x,u,flag)
switch flag,
case 0
[sys,x0,str,ts]=mdlInitializeSizes;
case 2
sys=mdlUpdates(t,x,u);
case 3
sys=mdlOutputs(t,x,u);
case {1,4,9}
sys=[];
otherwise
error(['unhandled flag=',num2str(flag)]);
end
%s函数主程序结束
function[sys,x0,str,ts]=mdlInitializeSizes
sizes=simsizes;
sizes.NumContStates=0;
sizes.NumDiscStates=3;
sizes.NumOutputs=2;
sizes.NumInputs=3;
sizes.DirFeedthrough=1;
sizes.NumSampleTimes=1;
sys=simsizes(sizes);
x0=[0;0;0];
global U;
U=[0;0];
str=[];
ts=[0.05 0];
%初始化子函数结束
function sys=mdlUpdates(t,x,u)
sys=x;
%end of mdlUpdate.
最后
以上就是酷酷歌曲最近收集整理的关于matlab中的myerr,Error in 'MPC1/S-Function' while executing MATLAB S-function 'MY_MPCCon...的全部内容,更多相关matlab中的myerr,Error内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复