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.

Réponses (1)

array = input('Enter elements of array'); %%Enclose the input in square braces when matlab asks
%%for it

Catégories

En savoir plus sur Entering Commands dans Centre d'aide et File Exchange

Produits

Tags

Question posée :

le 23 Fév 2014

Commenté :

le 23 Fév 2014

Community Treasure Hunt

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

Start Hunting!

Translated by