How to select particular column in xlsx file using xlsread function of MATLAB ?

27 views (last 30 days)
Hi Everybody,
Quite frequent I am to this site nowadays.
I have one xlsx file.I have near about 20-30 columns of mix data type. I want to plot few numerical columns which are spread in between of these columns. I have been using xlsread function like below
But among these columns I want to plot only A clm vs M clm.How to declare this instead of using long range.

Accepted Answer

Matthew Eicholtz
Matthew Eicholtz on 1 Aug 2017
Does this work?
A = xlsread('test.xlsx','sheet1','A:A');
M = xlsread('test.xlsx','sheet1','M:M');
Matthew Eicholtz
Matthew Eicholtz on 1 Aug 2017
I'm guessing the samples containing text show up as NaN when you use xlsread? If so, after running the code shown in my answer, you can use:
mask = isnan(A)|isnan(M);
A(mask) = [];
M(mask) = [];

Sign in to comment.

More Answers (0)


Find more on Large Files and Big Data 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!

Translated by