![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1535675/image.png)
Index exceeds the number of array elements
1 次查看(过去 30 天)
显示 更早的评论
>> 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
0 个评论
回答(1 个)
Neelanshu
2023-11-10
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1535675/image.png)
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
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!