While solving boundary value problems (using bvp4c) the graph is plotted as the command ""plot (x,BS(1,:))"" but if I want the graph between x and y and not x and boundary solution (BS) what should I do ?
1 次查看(过去 30 天)
显示 更早的评论
This is the matlab script :
init = bvpinit(linspace(-1,1,20),[0 0]);
sol=bvp4c(@rhs_bvp,@bc_bvp,init);
x = linspace(-1,1,20);
BS=deval(sol,x);
plot(x,BS(1,:));
I do not understand the purpose of deval, also the graph i want to plot is between x and y not x and boundary solutions (bs).
How can i do that ?
0 个评论
采纳的回答
infinity
2019-7-14
Hello,
You might simply plot x and y like this
plot(sol.x, sol.y, '-o')
Several examples of how to use bvp4 and deval can be seen here
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Boundary Value Problems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!