How to add a result on a plot.
7 ビュー (過去 30 日間)
古いコメントを表示
I have made a program that calculates the root of a function. I want to have text saying "the root of the function is at x=(result calculated by program) on the plot. I am using the text command to print the message where I want but I don't know how to print the result itself on plot. Can someone help me?
0 件のコメント
採用された回答
KL
2017 年 11 月 27 日
use num2str to convert the result to string and use it inside text command,
text(x_pos, y_pos, ['the root of the function is at x = ', num2str(result)])
2 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!