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:
xlsread function

Subject: xlsread function

From: Mohammed Yahia

Date: 22 Mar, 2011 21:36:05

Message: 1 of 3

how can I read, for example, the first and forth columns from excel file using xlsread function.

Example:
A=xlsread('C:\example\sample.xls','salalry','????')
What is the range that I can use instead of ????
I tried 'A1:A10 ; D1:D10' as Excel's range format but it doesn't work. It reads only the first range 'A1:A10'.

Any helps?

Subject: xlsread function

From: Sadik

Date: 23 Mar, 2011 01:20:23

Message: 2 of 3

Hi Mohammed,

You may try the following which suggests reading all four columns and then doing the selection inside matlab:

A=xlsread('myExcelFile.xls','mySheet','A1:D10');
A = A(:,[1 4]);

Best.

Subject: xlsread function

From: Mohammed Yahia

Date: 23 Mar, 2011 11:53:05

Message: 3 of 3

"Sadik " <sadik.hava@gmail.com> wrote in message <imbhsn$g3g$1@fred.mathworks.com>...
> Hi Mohammed,
>
> You may try the following which suggests reading all four columns and then doing the selection inside matlab:
>
> A=xlsread('myExcelFile.xls','mySheet','A1:D10');
> A = A(:,[1 4]);
>
> Best.

Thanks

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