How do i get multiple inputs from keyboard and store them in an array

4 ビュー (過去 30 日間)
CunKang S
CunKang S 2014 年 2 月 23 日
コメント済み: Walter Roberson 2014 年 2 月 23 日
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
Walter Roberson 2014 年 2 月 23 日
What you are doing should work, resulting in "values" being a vector.

サインインしてコメントする。

回答 (1 件)

Dishant Arora
Dishant Arora 2014 年 2 月 23 日
array = input('Enter elements of array'); %%Enclose the input in square braces when matlab asks
%%for it

カテゴリ

Help Center および File ExchangeEntering Commands についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by