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

8 Ansichten (letzte 30 Tage)
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
data=xlsread('test.xlsx','sheet1','A1:M70023').
But among these columns I want to plot only A clm vs M clm.How to declare this instead of using long range.
Thanks.

Akzeptierte Antwort

Matthew Eicholtz
Matthew Eicholtz am 1 Aug. 2017
Does this work?
A = xlsread('test.xlsx','sheet1','A:A');
M = xlsread('test.xlsx','sheet1','M:M');
plot(A,M);
  3 Kommentare
POKA
POKA am 1 Aug. 2017
Just One more doubt , suppose I have one or two text in my
numerical data column which are nothing but bad data. How can I
plot those column. I mean how to skip those text and plot with rest of the data.
Matthew Eicholtz
Matthew Eicholtz am 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) = [];
plot(A,M);

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Graphics Performance finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by