필터 지우기
필터 지우기

Why does my menu selection screen not show all the values?

조회 수: 1 (최근 30일)
Gavin Thompson
Gavin Thompson 2021년 9월 8일
댓글: Gavin Thompson 2021년 9월 8일
Days = [1;2;5;6;8;10;12];
LocationID = ["NW102","SE321","ESE020"];
% Prompt user to select day and location based on data provided
dayChoice = menu('Please select a day',Days);
locationChoice = menu('Please select a location',LocationID);
Whenever I run this script, on the user selection interface for Days the only value that shows up is 1. It works perfectly fine for the LocationID choice selection so I'm not sure whats wrong. I have tried converting Days into a row vector but that hasn't helped either.

채택된 답변

Walter Roberson
Walter Roberson 2021년 9월 8일
options must be a cell array of character vectors, or a string array. Yours is neither of those.
  댓글 수: 1
Gavin Thompson
Gavin Thompson 2021년 9월 8일
Thank you, I converted it to a string array and now it works perfectly.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by