why i got this error?

5 vues (au cours des 30 derniers jours)
Nadim Mhanna
Nadim Mhanna le 29 Sep 2017
Commenté : Jan le 30 Sep 2017
Unexpected error
function dFdx=funode(x,F)
global Lamda
global K1
global P
dFdx=[F(2) ; -K1*P+F(1)*Lamda^2];
function res=myfunbc(Fa,Fb)
global P
res=[Fa(1) ; Fb(1)-P];
solinit=bvpinit(linspace(0,l,2),[1 0]);
sol = bvp4c(@funode,@myfunbc,solinit);
x = linspace(0,l);
F = deval(sol,x);
After that i have an error The derivative function ODEFUN should return a column vector of length 2. why?

Réponse acceptée

James Tursa
James Tursa le 29 Sep 2017
Modifié(e) : James Tursa le 29 Sep 2017
Make it a column vector as requested:
dFdx=[F(2) ; -K1*P+F(1)*Lamda^2];
  11 commentaires
Nadim Mhanna
Nadim Mhanna le 30 Sep 2017
okay got it Thanks all
Jan
Jan le 30 Sep 2017
@Nadim Mhanna: Please do not use flags to mark a "best answer". Flagging is thought to inform admins and editors, that a contribution needs attention, because it violates the terms of use, e.g. by rudeness.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming 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!

Translated by