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개)

카테고리

제품

질문:

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