フィルターのクリア

Error: variable might be used before it is defined.

26 ビュー (過去 30 日間)
Fareeha
Fareeha 2023 年 8 月 11 日
コメント済み: Torsten 2023 年 8 月 11 日
kindly check screenshot for reference.

回答 (2 件)

Ruchika
Ruchika 2023 年 8 月 11 日
移動済み: Image Analyst 2023 年 8 月 11 日
The error message "variable might be used before it is defined" typically occurs when you're trying to use a variable before it has been assigned a value or initialized. This error can often be resolved by ensuring that you define or initialize your variables properly before using them in your MATLAB code. In this code, 'yy3' has been used to initialise 'yy2' before being initialised itself. You want to have an initial value for 'yy3' before using it to resolve this error.

VBBV
VBBV 2023 年 8 月 11 日
編集済み: VBBV 2023 年 8 月 11 日
Change this line
yy2 = Pr*(y(4)*y(2)-y(1)*y(5)-Df*yy3-Nb*y(5)*y(7)-Nt*y(5)^2)
to
yy2 = Pr*(y(4)*y(2)-y(1)*y(5)-Df*y(3)-Nb*y(5)*y(7)-Nt*y(5)^2)
% ^^
  6 件のコメント
Fareeha
Fareeha 2023 年 8 月 11 日
編集済み: Fareeha 2023 年 8 月 11 日
@Torsten I tried it and get this error
Error using bvparguments (line 108)
Error in calling BVP5C(ODEFUN,BCFUN,SOLINIT):
The derivative function ODEFUN should return a column vector of length 8.
Error in bvp5c (line 137)
bvparguments(solver_name,ode,bc,solinit,options);
Error in SAD_Sol_bvp4c (line 17)
sol = bvp5c(@bvp2D, @bc2D, sol1);
Torsten
Torsten 2023 年 8 月 11 日
If you have an initial vector of length 8, you must return a dydt vector of length 8.

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

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by