Index exceeds the number of array elements

>> run_LE_FO_a
p_step =
1.499999999999999e-03
Index exceeds the number of array elements. Index must not exceed 1.
Error in LE_RF_a (line 5)
X= [x(5), x(9), x(13), x(17);
Error in FDE12>f_vectorfield (line 300)
f = feval(Probl.fdefun,t,y,Probl.param) ;
Error in FDE12 (line 114)
f_temp = f_vectorfield(t0,y0(:,1),Probl) ;
Error in FO_Lyapunov_a (line 22)
[T,Y] = FDE12(q,ext_fcn,t,t+h_norm,[0 0 1 1],h,a);
Error in run_LE_FO_a (line 16)
lp=FO_Lyapunov_a(ne,ext_fcn,0,0.2,1,[0 0 1 1],0.2,1,a)
>>
fde12 only work on 3 dimensional? if you want to work on 4 dimensional where i have to change

回答 (1 件)

nick
nick 2023 年 11 月 10 日

0 投票

Hi Rohini,
I understand that you are facing issue when working on 4-dimensional vector as input argument in ‘FDE12.m’.
I have debugged the code and found that while using 4 dimensions, in 'LE_RF_a.m' you are accessing 5th 6th 7th elements etc which is the cause of error, as shown below:
Also refer to line 114 in 'FDE12', it should be like shown below as y0 is a row vector
f_temp = f_vectorfield(t0,y0(1,:),Probl) ;
instead of
f_temp = f_vectorfield(t0,y0(:,1),Probl) ;
Hope it helps,
Regards,
Neelanshu

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

リリース

R2021a

タグ

質問済み:

2022 年 5 月 25 日

回答済み:

2023 年 11 月 10 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by