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

Thread Subject:
dlmread error??

Subject: dlmread error??

From: Jack

Date: 15 Jun, 2009 02:26:01

Message: 1 of 6

I am new to matlab and I have a csv file that I am trying to import; however, I am getting an error:
>> M = dlmread('ADRY_Pre_Leg_WCONT_rms.csv', ' ', 2, 1);
??? Index exceeds matrix dimensions.
Error in ==> dlmread at 150
result = result{1};

Can anyone please explain this to me or describe how I should be importing this file?

The file has 92800 rows and 12 columns; each row is a different variable.

Any help is appreciated!
Thanks!

Subject: dlmread error??

From: Sadik

Date: 15 Jun, 2009 02:41:01

Message: 2 of 6

Perhaps the function xlsread is going to work.

"Jack " <use.text.after.underscore.only_jcannon@csu.edu.au> wrote in message <h14bfp$gvv$1@fred.mathworks.com>...
> I am new to matlab and I have a csv file that I am trying to import; however, I am getting an error:
> >> M = dlmread('ADRY_Pre_Leg_WCONT_rms.csv', ' ', 2, 1);
> ??? Index exceeds matrix dimensions.
> Error in ==> dlmread at 150
> result = result{1};
>
> Can anyone please explain this to me or describe how I should be importing this file?
>
> The file has 92800 rows and 12 columns; each row is a different variable.
>
> Any help is appreciated!
> Thanks!

Subject: dlmread error??

From: Sadik

Date: 15 Jun, 2009 02:47:01

Message: 3 of 6

Actually I have realized that there is a function called csvread. But help says: "The file can only contain numeric values."


"Sadik " <sadik.hava@gmail.com> wrote in message <h14cbt$ag6$1@fred.mathworks.com>...
> Perhaps the function xlsread is going to work.
>
> "Jack " <use.text.after.underscore.only_jcannon@csu.edu.au> wrote in message <h14bfp$gvv$1@fred.mathworks.com>...
> > I am new to matlab and I have a csv file that I am trying to import; however, I am getting an error:
> > >> M = dlmread('ADRY_Pre_Leg_WCONT_rms.csv', ' ', 2, 1);
> > ??? Index exceeds matrix dimensions.
> > Error in ==> dlmread at 150
> > result = result{1};
> >
> > Can anyone please explain this to me or describe how I should be importing this file?
> >
> > The file has 92800 rows and 12 columns; each row is a different variable.
> >
> > Any help is appreciated!
> > Thanks!

Subject: dlmread error??

From: Kian

Date: 15 Jun, 2009 03:00:18

Message: 4 of 6

Try dragging and dropping your XLS file into MATLAB's Command Window. It will bring up a window and you will be able to specify what delimeter you'd like to use to parse the data.

Subject: dlmread error??

From: Kian

Date: 15 Jun, 2009 03:03:00

Message: 5 of 6

Also, what happens when you use:

dlmread('ADRY_Pre_Leg_WCONT_rms.csv', ' ', 2, 1)

without assigning it to a variable (i.e. M)? Will it read it?

Also, what kinda data are you trying to read? Numbers? Text? Mixed?

Subject: dlmread error??

From: Jack

Date: 15 Jun, 2009 03:24:02

Message: 6 of 6

Thanks everyone for your suggestions... I fixed the problem using the csvread function and specifying the R and C where the numeric data starts..

Thanks again.
Jack

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us