Plotting column wise data from multiple sheets of Excel spreadsheet into single Scatter plot

5 views (last 30 days)
Hi, I have one question.Let say I have an excel workbook with 5 separate sheets in it. In each sheet i have column wise data. Now, I want to plot a single scatter plot from all of sheets having two column wise variables let say A and B .
so that i can get one single scatter plot so that i can compare different data sets from each sheet.Also I want to have a single trend line from all data sets so that it can be showed variation of data from trend line and different data sets.
Can anybody give me hint regrading this ??
dataset = xlsread('AllSource_MicArr1.xlsx','Src_1MIC_Array1','A4:T51');
x =dataset(:,10);
y = dataset(:,13);
dataset1 = xlsread('AllSource_MicArr1.xlsx','Src_2MIC_Array1','A4:T51');
a = dataset1(:,10);
b = dataset1(:,13);
dataset2 = xlsread('AllSource_MicArr1.xlsx','Src_3MICArray_1','A4:T51');
c = dataset2(:,10);
d = dataset2(:,13);
dataset3 = xlsread('AllSource_MicArr1.xlsx','Src_4MICArray_1','A4:T51');
e = dataset3(:,10);
f = dataset3(:,13);
scatter(x,y);
hold all
scatter(a,b);
grid on
scatter(c,d);
scatter(e,f);
xlim([-40 80]);
ylim([-40 60]);
xlabel('phi ground');
ylabel('phi sim');
title('Variation between phi ground and phi simulated');
legend('Phi ground and simulated');
  6 Comments
Ahmad Bilal
Ahmad Bilal on 24 Sep 2018
Yes, I works now. But still i am facing one problem i want a trend line that passes from all data sets but when i try to create trend line it only gives me a trend line for one data set. Can you help me in this regard.
Bob Thompson
Bob Thompson on 24 Sep 2018
I think your best way to do this would be to create a separate plot with all points in a single dataset, and then generate a trend line for that new dataset.
That's just my first thought, but I admittedly don't know that much about trend lines in Matlab.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!