All I want to do (initially) is read an Excel or csv file
Show older comments
Hi- I'm at the pre-novice level. Your patience is requested.
I have a csv file that has the top row containing column identifiers ( about 20 columns) and every row after that containing data.
All I want to do is read the data into Matlab. I've tried all sorts of commands but all I get is error messages. I don't want to use the import wizard--I need to learn how to write the commands.
How about a shove in the right direction?
Accepted Answer
More Answers (1)
Fangjun Jiang
on 7 Nov 2011
0 votes
try d=importdata('test.csv') and check the value of d in MATLAB workspace.
5 Comments
Frank
on 7 Nov 2011
Fangjun Jiang
on 7 Nov 2011
Specify the full path of the file like 'c:\mydocument\test.csv', or use
[FileName,PathStr]=uigetfile;
d=importdata(fullfile(PathStr,FileName))
Frank
on 7 Nov 2011
Frank
on 8 Nov 2011
Eric
on 10 Nov 2011
I believe csvread has received a reprieve. In the Matlab R2010b Release Notes:
csvread and csvwrite Will Not Be Removed
The R2010a Release Notes originally stated that csvread and csvwrite would be removed in a future release. As of R2010b, there are no plans to remove these functions.
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!