Error in Bvp4c

2 views (last 30 days)
Priya M
Priya M on 23 Oct 2021
Commented: Priya M on 28 Oct 2021
I'm trying to run the following bvp4c MATLAB code, but keep running into an error:
please anyone find out my mistakes and correct me..
Thank you.

Accepted Answer

Jan on 23 Oct 2021
You define the variable beta on top of the code, but this does not mean, that it is known in all subfunctions. Pr, gamma and lam are not known inside also.
Either define the constants, where they are needed, or provide them using an anonymous function:
for gamma=0.0:0.25:1
sol = bvpinit(linspace(0,5,50),[0 0 0 0 0 0 0]);
fcn = @(t,y) bvpexam1(t, y, beta, gamma, lam, Pr);
sol1 = bvp4c(fcn, @bcexam1,sol);
function ysol = bvpexam1(t, y, beta, gamma, lam, Pr)
Priya M
Priya M on 28 Oct 2021
Thanx a lot sir....

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by