|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
在simulink中搭建了模型,主程序使用matlab function写的,调用了两个子程序,其中一个因为分配了动态数组所以会报错,报错如下:
$ ~2 @$ J1 Z% d; o
$ d. g, B% H4 f( c U) MComputed maximum size of the output of function 'colon' is not bounded.( o5 n; x2 E5 n/ z& ~$ p. p
Static memory allocation requires all sizes to be bounded.
% T) v* L4 H& b4 BThe computed size is [1 x :?].
; h9 w: n- f1 i5 M
5 X& F0 P: \' }* IFunction 'Engine_State_inteRF0304.m' (#46.1271.1292), line 33, column 12:
5 m/ C! j7 @" H- O' \"Te_min(i):1:Te_max(i)"+ S3 W0 h: j# \' C7 S
Launch diagnostic report.2 y O8 w; f; R, R$ ~9 F
9 z" M2 q( j! G: K3 K, l; g. P
4 e4 q0 X# \: s% ?
7 k, q4 a; @5 B下面是我这部分程序。刚接触simulink,一头雾水,被这个问题困扰很多天了,希望大神们可以提供解决思路。不胜感激!
5 p7 T7 A/ J8 { X" A2 \; k: Z: d. J3 ^
if T_req(i)>=0
3 j- O! E. t Q/ F$ l4 E- W* ] Te_max(i)=interp1(engine_fullload_speed,engine_fullload_torque,n_e(i));%利用一维线性插值法求发动机转矩最大值
" A( e9 ]4 a: d+ S" Y Te_min(i)=Te_max(i)*0.2; %低于此转矩值,发动机关闭 # C& J' F( y" E3 W* @: V
if T_req(i)>=Te_min(i). W G K! a! x4 v0 |" c, W2 q4 I
Te=Te_min(i):1:Te_max(i); ! l: o) X$ S8 ^( f* u) z- O
Te=Te( ;
- D4 R( h! z2 q) Q" p, L else
% t* r& e7 _3 i Te=0;
) c! v7 O; Y; ~8 R! L end9 P& d6 h: I0 k: w3 U U" F
|
|