menu not showing elements in string array

1 vue (au cours des 30 derniers jours)
Alexandre
Alexandre le 20 Oct 2023
Commenté : Voss le 20 Oct 2023
Hi,
im trying to open an menu with a string array and a additional option like
savedFileNames = ["fic1.txt" "fich2.txt" "fich3.txt" "fich4.txt"];
menuOption = menu('Choose file.', savedFileNames, 'Return to previous menu');
when i run the code the menu only has the first string(fic1.txt) and the 'return to menu' options. How do i fix this?

Réponse acceptée

Voss
Voss le 20 Oct 2023
menuOption = menu('Choose file.', savedFileNames{:}, 'Return to previous menu');
This passes the elements of savedFileNames as a list of input arguments to menu, rather than passing the entire savedFileNames array as a single input argument to menu.
  2 commentaires
Alexandre
Alexandre le 20 Oct 2023
Thank you!
Voss
Voss le 20 Oct 2023
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Compiler dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by