|  | 
 
| 
在simulink中搭建了模型,主程序使用matlab function写的,调用了两个子程序,其中一个因为分配了动态数组所以会报错,报错如下:
x
EDA365欢迎您登录!您需要 登录 才可以下载或查看,没有帐号?注册  + g; H' X8 x6 s% Y. I4 \, n5 q' ?# E% p1 c2 B
 Computed maximum size of the output of function 'colon' is not bounded.
 7 i  W% o7 i, ~" W- z& bStatic memory allocation requires all sizes to be bounded.8 J) {! M& Z; w! b0 o2 h
 The computed size is [1 x :?].9 b/ Y" ], N" @3 |3 Z: o5 K
 6 `* X! I! C- ]
 Function 'Engine_State_inteRF0304.m' (#46.1271.1292), line 33, column 12:/ }. C& Y5 r, G$ W  l
 "Te_min(i):1:Te_max(i)"
 # `+ k$ h% z$ O3 w) Q) jLaunch diagnostic report.4 C% Z6 ?& {+ q1 s8 {
 
 K$ n0 S$ E0 l! x& Y$ u2 D9 |7 o/ s7 ~
 `# d: K' k" {% V2 Q
 下面是我这部分程序。刚接触simulink,一头雾水,被这个问题困扰很多天了,希望大神们可以提供解决思路。不胜感激!
 : m- F$ y( N( D2 c% }
 " ?& L3 ~( g  S+ yif T_req(i)>=0 0 O8 P' E2 A% c, q  [
 Te_max(i)=interp1(engine_fullload_speed,engine_fullload_torque,n_e(i));%利用一维线性插值法求发动机转矩最大值/ L' f% k# v5 ?" w+ ^- r
 Te_min(i)=Te_max(i)*0.2; %低于此转矩值,发动机关闭 0 l- Y) W  U( D6 v1 f8 i
 if T_req(i)>=Te_min(i)
 1 _9 ?4 S% E% ~8 J7 ]        Te=Te_min(i):1:Te_max(i); 1 c; `; N6 U8 V8 O5 J1 H
 Te=Te(
  ; ' D6 Z5 B0 n3 ]. ?1 {/ k# o    else% S) C% d8 I2 E
 Te=0;
 7 h! ~6 J6 k. `4 D' z3 J1 Y7 a    end, m6 h  ?; ^  a0 c; A* s$ m. ^
 
 | 
 |