In my .csv file have four columns I need to access each 1st column. Is there any matlab code doing easy that kind of task. file data mention in below

 Réponse acceptée

Walter Roberson
Walter Roberson le 4 Mar 2018

0 votes

The easiest way is to use csvread() to read the entire matrix and then access the first column.

6 commentaires

Asanka Dewappriya
Asanka Dewappriya le 4 Mar 2018
yeah, I used csvread() then how can I read first column?
data = csvread('YourFile.csv');
column1 = data(:,1);
Asanka Dewappriya
Asanka Dewappriya le 5 Mar 2018
I used that code but I can't get actual output that output I mention in below.I need get all float value in 1st column.
Walter Roberson
Walter Roberson le 5 Mar 2018
Modifié(e) : Walter Roberson le 5 Mar 2018
Please attach your file. You might need to zip it and attach the zip
I wonder whether your csv file happens to try to use comma as the decimal indicator, as happens in some parts of Europe (especially Germany it seems.)
Asanka Dewappriya
Asanka Dewappriya le 5 Mar 2018
This is file
I do not get that result at all.
data = csvread('DOWN.csv');
data(1:10,1)
ans =
1.15
1.196
1.201
1.172
1.138
1.16
1.194
1.213
1.199
1.189

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by