
Solution for a Subplot in loop reading from multiple columns with an increment and from different excel sheets
3 次查看(过去 30 天)
显示 更早的评论
Hi all,
I am reading a .xlsx file with three sheets. I am trying to subplot x and y from each sheet which are in increments.
Here is the example for subplot (8,3,1)
Example 1: Subplot 1 includes the following data
(x1,y1)=(a(:,1),a(:,2)) % continues with an increment of 3 columns for subplot (8,3,2) and so on.
(x2,y2)=(b(:,1),b(:,2)) % continues with an increment of 3 columns for subplot (8,3,2) and so on.
(x3,y3)=(c(:,1),c(:,2)) % continues with an increment of 3 columns for subplot (8,3,2) and so on.
The following code is just getting them all in a single chart.
a=xlsread('Doc1.xlsx','sheet1');
b=xlsread('Doc1.xlsx','sheet2');
c=xlsread('Doc1.xlsx','sheet3');
x1=a(:,1:3:70);
y1=a(:,2:3:71);
x2=b(:,1:3:70);
y2=b(:,2:3:71);
x3=c(:,1:3:70);
y3=c(:,2:3:71);
figure(1)
plot(x1,y1,x2,y2,x3,y3)
figure(2)
for t1=1:24
subplot(8,3,t1)
plot(x1,y1,x2,y2,x3,y3)
end
figure(2) gives all the sublpots with all the data. Can someone look into this code and suggest me how to overcome this?
Kind regards,
Jagan
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!