Vladamir
Vladamir

Reputation: 247

Matlab - Reading CSV data

I need to import data from a CSV file containing text and numbers, as shown below. csvread and other methods dont seem to be working, is there a way around this?

enter image description here

Upvotes: 1

Views: 68

Answers (1)

Stewie Griffin
Stewie Griffin

Reputation: 14939

I suggest you try readtable:

T = readtable('csv_file.csv',...
    'Range','CA4:F11',...
    'ReadVariableNames',true)

I'm not sure if it will be able to handle % TYPE in A4, but you might have to delete that cell for this to work.

Note: You have to save this as a .xls, .xlsx, .xlsm, .xltx, or .xltm-file for this to work. It's easy to import a csv file into excel and save it as an xlsx-file, so that shouldn't be a problem if you have MS Office.

It's of course possible to do this using the csv-file directly, but that's a bit more messy.

Upvotes: 1

Related Questions