Scanning a CSV file

I want to read a CSV(Comma Separated Values) file in a text format and bring the entire data from CSV into Matlab environment

Risposte (1)

Voss
Voss il 28 Dic 2021

0 voti

You could use readmatrix(), csvread(), xlsread(), textscan(), fread(), etc.

4 Commenti

Walter Roberson
Walter Roberson il 28 Dic 2021
readmatrix() did not exist when the question was asked in 2011.
Note: load() would also have worked with that format, if it was all numeric without any header line.
Voss
Voss il 28 Dic 2021
I didn't realize answers were constrained to functions available at the time the question was asked.
Walter Roberson
Walter Roberson il 28 Dic 2021
The expectation is that replies will typically be appropriate to the version available to the poster, or else will be marked as requiring a newer version.
For example, "You could use csvread(), xlsread(), textscan(), fread(), etc. In new enough versions you could use readmatrix()"
Voss
Voss il 28 Dic 2021
I have no expectation that the poster will read the answer at all in this case.
I only listed readmatrix() first because it seems to be the latest preferred method; I've never had reason to use it myself.

Accedi per commentare.

Tag

Richiesto:

il 13 Nov 2011

Commentato:

il 28 Dic 2021

Community Treasure Hunt

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

Start Hunting!

Translated by