Optionally create plots inside function

18 次查看(过去 30 天)
I have a function
y=myfun(x)
y=3*x;
plot(x, y)
If x=[1 2 3 4 5]; then the plot will be plotted. Is there anyway to control if I want to make the plot or not?

采纳的回答

Image Analyst
Image Analyst 2013-8-26
Yes. Don't call plot() if you don't want it plotted.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by