필터 지우기
필터 지우기

Request user input and using that ans for my functions?

조회 수: 2 (최근 30일)
Gee Cheng Mun
Gee Cheng Mun 2016년 1월 15일
답변: Stephen23 2016년 1월 15일
How can I use the user's input and convert it to a numerical value to be used in my remaining codes?
prompt=('Enter a threshold value to convert the grayscale image to black and white: ');
dlg_title=('Threshold level value');
num_lines=1;
defaultans={'0.5'};
answer=inputdlg(prompt,dlg_title,num_lines,defaultans);

채택된 답변

Stephen23
Stephen23 2016년 1월 15일
>> val = str2double(answer{1})
val =
3

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by