take input in array

8 次查看(过去 30 天)
Tejas Mahajan
Tejas Mahajan 2020-10-9
if i want user to to input n number of values in the input window in array form how should i do it

采纳的回答

Ameer Hamza
Ameer Hamza 2020-10-9
vec = input('Enter an array: ')
run the above line and type
[1,2,3,4]
in the command window. You will get
>> vec
vec =
1 2 3 4

更多回答(1 个)

madhan ravi
madhan ravi 2020-10-9
Use input() , enter the values in the form [1,5,4] an example.
doc input

类别

Help CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by