フィルターのクリア

ode error

2 ビュー (過去 30 日間)
Taniadi
Taniadi 2012 年 4 月 27 日
Hi all, i want to ask about my M-File. I cant run this code i made
function dGdW = PBR(W,Y)
global yao Fk0 Q0 T0 Dp miu G P0 A rhog0 rhoCat phi
%dGdW = zeros(3,1);
X = Y(1); % conversion
T = Y(2); % temperature
y = Y(3); % P/Po
... (another script)
dGdW = [-rate/Fao
rate*dHr/(Fa*Cpa+Fb*Cpb+Fc*Cpc+Fd*Cpd*Fe*Cpe)
-(alpha/(2*y))*(1+ea*X)*(T/T0)];
i'm running that in one m-file using this :
[w,Y] = ode23s(@PBR,[0 37.5],[0 450 1])
when i run, i get this error code:
"Solving PBR requires an initial condition vector of length 3."
Why is that error occurs? I have no idea why that error occurs, because I think I have enter correct initial conditions.
Thanks for help

採用された回答

Jan
Jan 2012 年 4 月 28 日
I do not see the error in the posted code. I suggest to use the debugger to find out more:
dbstop if error
Then inspect the current values of the variables and the caller stack.
  1 件のコメント
Taniadi
Taniadi 2012 年 5 月 3 日
thanks for the advice :) . I have found the errors. It is because I forgot to global variables i used in second functions. So it gave third output error.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDebugging and Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by