No License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from

4.8 | 8 ratings Rate this file 3 Downloads (last 30 days) File Size: 578 Bytes File ID: #3123 Version: 1.0
image thumbnail




13 Mar 2003 (Updated )

CSVREAD for files with varying number of cols.

| Watch this File

File Information

If you have a file that has more commas in some lines than others, this is for you.

It's very simple, but it may help some of you.

MATLAB release MATLAB 6.1 (R12.1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (8)
08 Dec 2016 Dan

Dan (view profile)

Works great

03 Sep 2012 Jonathan

Adding this code to the end of the function makes a variable for each column. The name is taken from the first (header) row

data = MM;
clear MM;
for i=1:size(data,2)
cmd = ['MM.' data{1,i} ' = data(2:end,' num2str(i) ');'];

19 Mar 2009 Sahin Aktas

21 Oct 2008 Michael Koelemay

This function is indeed really great, and robust.

I added 1 line to hugely boost performance by preallocating the output array "MM". To do this, just add this line right before the "for" loop:


17 Feb 2006 Chris Zhou

Excellent reader, but consume too much memory for large files

15 Jan 2006 Dan Don

Simple and effective

28 Feb 2005 Francis Pieraut

Great! This function should be include by defalut in matlab. It works perfectly.

01 Apr 2004 Ricardo Pachon

Indeed, it can help you! Perhaps you must add a few lines so it fits your needs, but it will work fine.

Contact us