Adding a plot to my code
古いコメントを表示
I've attached my code which performs the Jacobi method and is working correctly. However, I need to calculate the residual, rk which is the infinity norm of (Ax(k) - b ) divided by the infinity norm of b. What I need to do is calculate the natural log of rk and plot it against the iteration number K. I then need to be able to access the values on the y-axis.
I believe the code I need is
rk = (norm(A*x - b, inf)) / (norm(b,inf));
plot(log(rk),K);
but I have no idea how to incorporate this into my existing code or how to access the y-axis values. Is there anyone who could return the code to me with plotting commands? Thanks
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Calendar についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!