How do i get multiple inputs from keyboard and store them in an array
显示 更早的评论
How do i get multiple inputs from keyboard and store them in an array
% code
valstring = input('enter the number of points ', 's');
valparts = regexp(valstring, '[ ,]', 'split');
values = str2double(valparts);
I want to store them as an array to plot a graph.
1 个评论
Walter Roberson
2014-2-23
What you are doing should work, resulting in "values" being a vector.
回答(1 个)
Dishant Arora
2014-2-23
array = input('Enter elements of array'); %%Enclose the input in square braces when matlab asks
%%for it
类别
在 帮助中心 和 File Exchange 中查找有关 Desktop 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!