|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
在simulink中搭建了模型,主程序使用matlab function写的,调用了两个子程序,其中一个因为分配了动态数组所以会报错,报错如下:' O% C2 l/ p6 ?1 D
) d! Z! I0 a* y
Computed maximum size of the output of function 'colon' is not bounded.
: F: @. G4 I' l1 O+ `Static memory allocation requires all sizes to be bounded.9 h# Y/ q5 C: G5 T6 A2 U9 u
The computed size is [1 x :?].6 P8 c7 ]) q1 U; P$ F: P
+ B% X4 _! b9 ^" i; t3 D
Function 'Engine_State_inteRF0304.m' (#46.1271.1292), line 33, column 12:2 y0 j& x6 T2 l1 ]* y7 q x
"Te_min(i):1:Te_max(i)" X8 Q5 o0 z6 J. h* {! Y
Launch diagnostic report.
% ?7 R- a$ }* V$ ^9 y& y7 K9 M# R# J+ V( a; V, z
$ }# t2 r0 J& k
! X& Y# a: c0 }) O: _! J下面是我这部分程序。刚接触simulink,一头雾水,被这个问题困扰很多天了,希望大神们可以提供解决思路。不胜感激!
! Q+ y/ p9 d2 H; }, W; x. ?2 X0 S7 J3 M( A8 B4 g
if T_req(i)>=0 $ [4 p/ O3 [2 o! _
Te_max(i)=interp1(engine_fullload_speed,engine_fullload_torque,n_e(i));%利用一维线性插值法求发动机转矩最大值
* S2 S5 e( \) a+ c9 Y+ v Te_min(i)=Te_max(i)*0.2; %低于此转矩值,发动机关闭
! H: D( L! n) D* u if T_req(i)>=Te_min(i)
! h1 |' P7 h- v/ j4 m: ^ Te=Te_min(i):1:Te_max(i); - P. F) K1 E6 B& W3 o( ~
Te=Te( ;
% @3 Z# o* d) }* K else' N' }3 {/ i& D/ T% x- a6 G
Te=0;
3 s" n! f5 M* L# Q4 R end4 `- `3 D* S3 j2 d1 F
|
|