Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem Importing Data from a CSV file

Asked by Michael on 2 May 2013

I was wondering if someone could point me in the right direction on how to import the following data from a ".csv" file.

my goal is to import this data into matlab and plot this data.

I have tried to use dlmread and csv read and it appears the issue is that the data in the time column is a string.

here is the data that I would like to import:

Time               Pressure
17:59:45;261       81.845337
17:59:45;261       81.845337
17:59:45;261       81.845337
17:59:45;271       81.845337
17:59:45;281       81.845337

1 Comment

Anuj Agrawal on 2 May 2013

try "importdata"... it reads data with string headers.

Michael

Tags

Products

No products are associated with this question.

2 Answers

Answer by the cyclist on 2 May 2013

If you have a relatively recent version of MATLAB, consider using the Import Data tool that is available on the Home tab of the developer window.

0 Comments

the cyclist
Answer by Cedric Wannaz on 2 May 2013

You can also use TEXTREAD, as follows:

 [t, p] = textread('myFile.csv', '%s %f', 'delimiter', ' ', 'headerlines', 1) ;

0 Comments

Cedric Wannaz

Contact us