フィルターのクリア

error with function ode45

4 ビュー (過去 30 日間)
Cesar Cardenas
Cesar Cardenas 2023 年 2 月 21 日
コメント済み: Cesar Cardenas 2023 年 2 月 21 日
Hello,I created this function and file but I'm getting this error:
not sure what I'm doing wrong. Any help will be greatly appreciated.
Error using odearguments
When the first argument to ode45 is a function handle, the tspan argument must have at least two elements.
Error in ode45 (line 107)
odearguments(odeIsFuncHandle,odeTreatAsMFile, solver_name, ode, tspan, y0, options, varargin);
Error in blasius_solution (line 6)
[eta, f] = ode45 (@mufun, 0.5, [0; 0; guess]);
function dfdeta = mufun (eta, f)
dfdeta = [f(2); f(3); -0.5 * f(1) * f(3)];
end
clear all;
close all;
guess = 0.1;
[eta, f] = ode45 (@mufun, 0.5, [0; 0; guess]);
plot(f, eta);

回答 (1 件)

John D'Errico
John D'Errico 2023 年 2 月 21 日
You need to tell the ODEsolver FROM where, TO where will it integrate? So will the integration be, perhaps FROM 0 to 0.5?
All you have passed in is a scalar, the number 0.5. Should it be able to guess?
  1 件のコメント
Cesar Cardenas
Cesar Cardenas 2023 年 2 月 21 日
finally, I could solve it. thanks

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

カテゴリ

Help Center および File ExchangeOrdinary Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by