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:
help dlmread

Subject: help dlmread

From: Irene

Date: 5 Feb, 2011 22:23:03

Message: 1 of 3

Hello!
I'm trying to load data from a txt file to an array.The txt file has two columns of strings.I want to load only the FIRST column from the second row and below.I try this:

   C= dlmread('data.txt',' ',1,0);

The problem is that both columns are loaded.How can i load only the first one;
thank you

Subject: help dlmread

From: Wayne King

Date: 6 Feb, 2011 01:53:03

Message: 2 of 3

"Irene " <eleutherio88@gmail.com> wrote in message <iikik7$9sh$1@fred.mathworks.com>...
> Hello!
> I'm trying to load data from a txt file to an array.The txt file has two columns of strings.I want to load only the FIRST column from the second row and below.I try this:
>
> C= dlmread('data.txt',' ',1,0);
>
> The problem is that both columns are loaded.How can i load only the first one;
> thank you

Hi Irene, You are trying to read data from a file that contains strings using dlmread? dlmread() only works on numeric data. Can you clarify?

Wayne

Subject: help dlmread

From: Miroslav Balda

Date: 6 Feb, 2011 11:28:03

Message: 3 of 3

"Wayne King" <wmkingty@gmail.com> wrote in message <iikutv$8qn$1@fred.mathworks.com>...
> "Irene " <eleutherio88@gmail.com> wrote in message <iikik7$9sh$1@fred.mathworks.com>...
> > Hello!
> > I'm trying to load data from a txt file to an array.The txt file has two columns of strings.I want to load only the FIRST column from the second row and below.I try this:
> >
> > C= dlmread('data.txt',' ',1,0);
> >
> > The problem is that both columns are loaded.How can i load only the first one;
> > thank you
>
> Hi Irene, You are trying to read data from a file that contains strings using dlmread? dlmread() only works on numeric data. Can you clarify?
>
> Wayne

Hi Irene,
Read help textread.
Mira

Tags for this Thread

No tags are associated with 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