|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
在simulink中搭建了模型,主程序使用matlab function写的,调用了两个子程序,其中一个因为分配了动态数组所以会报错,报错如下:
, n. L& M# ?- W. m) _
- j7 |5 V! B6 f4 AComputed maximum size of the output of function 'colon' is not bounded.! h, d% Z- O3 A3 X& S4 l# [, z
Static memory allocation requires all sizes to be bounded.( m# G# c" n: y9 T' u% @
The computed size is [1 x :?].# s) \( K! A) e. U2 R6 D6 g9 `. E
; z9 J8 I; i5 o3 y
Function 'Engine_State_inteRF0304.m' (#46.1271.1292), line 33, column 12:; p# d8 ?" z+ X0 W* q" y
"Te_min(i):1:Te_max(i)"
( F! T- a# L" G1 L* VLaunch diagnostic report.( e: W0 e1 o7 X+ f% B. j
. q, V+ C# q! \0 P
' ^1 \/ `7 E( {7 M B2 B
( i& ]4 z: A; z, {8 S. v% P下面是我这部分程序。刚接触simulink,一头雾水,被这个问题困扰很多天了,希望大神们可以提供解决思路。不胜感激!
* i3 g6 ]) @- |9 s% y5 Q( k/ B
8 m' x- Q0 F5 N! h! vif T_req(i)>=0 7 O4 B2 V% j! I
Te_max(i)=interp1(engine_fullload_speed,engine_fullload_torque,n_e(i));%利用一维线性插值法求发动机转矩最大值
4 D+ v c( p) [) W Te_min(i)=Te_max(i)*0.2; %低于此转矩值,发动机关闭 - s: O' ? d, `! e/ X, I1 ^
if T_req(i)>=Te_min(i)
( o) t h9 j( I: n Te=Te_min(i):1:Te_max(i);
& |" e' x+ Y+ `5 G% j Te=Te( ;
4 m; ~0 e; p8 H/ x* t! } else
~; N* V$ k+ B- b Te=0;6 h" m# r) m, j9 y
end
+ a9 e) ?3 _6 p4 Z4 Z |
|