Effacer les filtres
Effacer les filtres

Request user input and using that ans for my functions?

2 vues (au cours des 30 derniers jours)
Gee Cheng Mun
Gee Cheng Mun le 15 Jan 2016
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);

Réponse acceptée

Stephen23
Stephen23 le 15 Jan 2016
>> val = str2double(answer{1})
val =
3

Plus de réponses (0)

Catégories

En savoir plus sur Import, Export, and Conversion dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by