Your code does not ask for multiple graphs.
You start with
which designates a single point. You do not specify at least two points and you do not specify a marker, so nothing shows up on the display when you do this. Mostly it has an effect on the automatic axes boundary selection, otherwise no effect on the display.
You then have
for i= 1:numel(pp)
k=1;
for lambda=pp(i)
Rd=qq(k);
sol= bvp4c(@projfun,@projbc,solinit);
k=k+1;
solinit= sol;
end
end
which kind of looks like a double nested for loop, but the "for lambda=pp(i)" is just a fancy way of saying "lambda=pp(i)" there since i is not a vector. So anyhow, you have a for i loop there, and there are no graphics within the loop. I am not clear as to why you are feeding solinit back through several rounds, but I guess there might be a reason for that.
After the loop you have
plot(2,1);plot(sol.x,sol.y(4,:));hold on
the plot(2,1) plots on top of the previous plot(2,1) -- except, as noted before, since that is only a single point and you did not specify a marker, that doesn't change the display (except perhaps the xlim and ylim chosen.)
The plot(sol.x,sol.y(4,:)) part selects the 4th output variable out of the 7 output variables and plots a line with just that one variable. So you get one line out of that.
... and that's the end of your program. You plotted the same invisible point twice, and you plot one line. The best you could hope for with that is the line together with a marker at (2,1) -- at most 2 outputs, not 9.
Best Answer