Optionally create plots inside function

10 vues (au cours des 30 derniers jours)
Giorgos Papakonstantinou
Giorgos Papakonstantinou le 26 Août 2013
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?

Réponse acceptée

Image Analyst
Image Analyst le 26 Août 2013
Yes. Don't call plot() if you don't want it plotted.
  1 commentaire
Giorgos Papakonstantinou
Giorgos Papakonstantinou le 26 Août 2013
Thank you, exactly what I had in mind.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by