フィルターのクリア

How to fix this error? Index exceeds the number of array elements (9). I already search and I still couldn't find the solution.

1 回表示 (過去 30 日間)
This is our coding. When we run, the error said that the index exceeds the number of array elements.
%==========INPUT ODE==========
function dydx=MixedPlate_ode(x,y,K,M,R,Pr,Sc,lambda,gamma,Du,Sr)
global K M R Pr Sc lambda gamma Du Sr
dydx=[y(2)
y(3)
((2*(y(2))^2)-(y(1)*y(3))-(2)-K*(y(5))+((M^2)*(y(2)-1))-(2*lambda*(y(6)+(gamma*y(9)))))/(1+K)
y(5)
(3*y(2)*y(4)-y(1)*y(5)+K*y(3)+2*K*y(4))/(1+K/2)
y(7)
(Pr*((4*y(2)*y(6))-(y(1)*y(7))-(Du*y(11))))/(1+(R*(4/3)))
y(10)
(Sc(4*y(2)*y(9))-(y(1)*y(10))-Sr*y(8))];
This is the error.
Index exceeds the number of array elements (9).
  1 件のコメント
Jonas
Jonas 2022 年 6 月 23 日
look like your input variable y has only 9 values and you ask for y(10) in the function

サインインしてコメントする。

回答 (1 件)

Ruchika P Barman
Ruchika P Barman 2022 年 7 月 8 日
It is my understanding that you are getting an error because you are trying to extract more than the number of elements present in the array. You are calling y(10) in the function but there is no tenth element present in y.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by