error with function ode45
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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);
0 commentaires
Réponses (1)
John D'Errico
le 21 Fév 2023
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?
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!