how to print values in graph window values in graph window
6 次查看(过去 30 天)
显示 更早的评论
I was wondering if there is an equivalent of the 'fprint' function that would print values in graph window instead of in work space. In other words, when I run the script that simply calculates x=X_m*sin(w*t), I want to display the values of X_m and w in small text box somewhere in figure window instead of in work space. And of course, I want this to be displayed automatically without clicking on the graph.
Thanks
0 个评论
采纳的回答
the cyclist
2013-7-20
You can use the text() function to write text on a figure.
doc text
for details.
3 个评论
the cyclist
2013-7-20
编辑:the cyclist
2013-7-20
For example, you can do
text(x,y,['SFDR = ',num2str(sfdr)])
where the variable sfdr has the value you want to display.
You could use sprintf() in place of num2str() as well, to get more control over the output.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Low-Level File I/O 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!