필터 지우기
필터 지우기

Creating Message Box for Variable selection Instead of command window request.

조회 수: 6 (최근 30일)
Hi guys,
I am wanting to make my script produce a message window to ask for a key input to select a variable. the only function of this is to populate 1 cell in an excel sheet as I do alot of test data. each data set has to havea contents page and title. it is the title that I am wanting to change,
Currently the script is
***********************************************************
variable={'variable 1' variable 2' 'variable 3' ' variable 4'....'Variable 9'}
option=input('Please indicate the name of the variable to be analysed: 1=variable 1\ 2 = variable 2\ 3= variable 3\ 4 = variable 4\....\9 = Variable 9
if option >= 1 && option <= 9
T = Vehicletitle{option};
end
***********************************************************
the variable then is used to be inserted to excel.
many thanks
James

채택된 답변

Matt Fig
Matt Fig 2012년 8월 7일
Perhaps something like this:
prompt = 'Please enter the name (1-9) to be analyzed';
name = 'Input vehicle number'
option = str2double(inputdlg(prompt,name,1,{'1'}))

추가 답변 (1개)

James hall
James hall 2012년 8월 8일
Worked a treat, thank you very much.
Just makes everything that much easier

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by