Finite difference method for second order ode
古いコメントを表示
Hi. I am trying to solve nonlinear equation using fsolve and repeat graph bet four times with different value. Here is my code:
Function main n = 10 r0 = ones(n, 1) For bet = 0.1:0.1:0.4 Sol = solve(@(r)fun(r, n), r0) norm(fun(sol, n)) end r = ((1:n)-1)/(n-1) Plot(r, sol(0.4,:),'g-*',sol(0.3,:),'m-*',sol(0.2,:),'b-*',sol(0.1,:),'r-*') end
3 件のコメント
Jan
2021 年 5 月 16 日
What is your question? The code does not run. Please format it correctly to improve the readability.
Oluwaseun Adisa
2021 年 5 月 16 日
Jan
2021 年 5 月 16 日
I've mentioned it already: Your code would not run at all, but stop due to the uppercase "Function" immediately.
Please post code in a readable format with one command per line.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!