How to ask to user if to run or not a part of code?

2 vues (au cours des 30 derniers jours)
Giuseppe
Giuseppe le 20 Juin 2021
Commenté : Giuseppe le 20 Juin 2021
Hi guys, I'd like to show a GUI in which the user can select "yes" or "not" to reply to the answer "Do yo want to plot the 3D trajectory?". So, based on the answer, the part of code after the question is exectuded or not.
Is it possible? If yes, how?
Thanks in advance!

Réponse acceptée

Matt J
Matt J le 20 Juin 2021
Modifié(e) : Matt J le 20 Juin 2021
For example,
if inputdlg('Proceed? [Y/N]')=="N"
break
end
There is also uiconfirm,
  1 commentaire
Giuseppe
Giuseppe le 20 Juin 2021
That's perfect but "break" must be removed.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by