menu not showing elements in string array

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?

 採用された回答

Voss
Voss 2023 年 10 月 20 日

0 投票

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 件のコメント

Alexandre
Alexandre 2023 年 10 月 20 日
Thank you!
Voss
Voss 2023 年 10 月 20 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

製品

質問済み:

2023 年 10 月 20 日

コメント済み:

2023 年 10 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by