How ask data to the user?

Hi all. I'm very new to matlab programming. I need to ask data to the user. How can I do?

2 个评论

What data?
Words. E.g. "What words do you prefere between house, work, chapel, laptop, skirt......?"

请先登录,再进行评论。

回答(1 个)

Read about input
prompt = 'Enter a value: ';
x = input(prompt)

3 个评论

Thank you so much! But it doesn't work with words..
prompt = 'Enter a string: ','s';
x = input(prompt)
Thank you so much!

请先登录,再进行评论。

类别

在 帮助中心 和 File Exchange 中查找有关 Data Import and Export 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by