generating a usable Matlab variable from csv file

1 vue (au cours des 30 derniers jours)
Daniel
Daniel le 28 Août 2014
Commenté : Daniel le 28 Août 2014
Is there anything along the lines of import wizard that can generate a variable, which you can then place in a matlab script? For example if you had a column in your csv file called "test" with row values of 1, 2, 3, matlab would create the following
test = [1 2 3];
which you could then obvioulsy use in your matlab code.
Or is something I would probably have to write a script myself to achieve?
  2 commentaires
José-Luis
José-Luis le 28 Août 2014
Depends on how the csv file looks like
Daniel
Daniel le 28 Août 2014
Right...I guess I was hoping you could use either cell arrays or just straight vectors depending on the data type it encounters

Connectez-vous pour commenter.

Réponse acceptée

Sean de Wolski
Sean de Wolski le 28 Août 2014
In R2014a, we introduced matlab.io.saveVariablesToScript which does this.
  1 commentaire
Daniel
Daniel le 28 Août 2014
looks like I'll have to upgrade. Thank you.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by