why i got this error?

조회 수: 6 (최근 30일)
Nadim Mhanna
Nadim Mhanna 2017년 9월 29일
댓글: Jan 2017년 9월 30일
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?

채택된 답변

James Tursa
James Tursa 2017년 9월 29일
편집: James Tursa 2017년 9월 29일
Make it a column vector as requested:
dFdx=[F(2) ; -K1*P+F(1)*Lamda^2];
  댓글 수: 11
Nadim Mhanna
Nadim Mhanna 2017년 9월 30일
okay got it Thanks all
Jan
Jan 2017년 9월 30일
@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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by