报错内容“Sample times matrix returned by Matlab S-function ' ctrl' in untitled/S-function must be empty”

function [sys,x0,str,ts]=mdlInitializeSizes

sizes = simsizes;
sizes.NumContStates = 5;
sizes.NumDiscStates = 0;
sizes.NumOutputs = 2;
sizes.NumInputs = 2;
sizes.DirFeedthrough = 1;
sizes.NumSampleTimes = 0; % at least one sample time is needed

sys = simsizes(sizes);
x0 = [ 0 0 0 0 0 ]’;
str = [];
ts = [0 0];

只需要把上面的ts = [ 0 0 ]; 改成 ts = [ ];就可以了

发布了2 篇原创文章 · 获赞 0 · 访问量 70
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 游动-白 设计师: 上身试试

分享到微信朋友圈

×

扫一扫,手机浏览