Plot multiple curves in one finger based on excel data sheet?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi All,
How to plot multiple curves based on excel 8 data sheets. Each sheet has 10 curves of (X,Y) data.
Ther is 2 version of the 8 data sheets:
- Firest 8 sheets contained only the loading part which ending with the numbers.
sheetnames = { 'MATLAB Ana00', 'MATLAB Ana01','MATLAB Ana02','MATLAB Ana03', 'MATLAB Ana04', 'MATLAB Ana05', 'MATLAB Ana06', 'MATLAB Ana07', 'MATLAB Ana08' };
- Second 8 sheets contained the loading and unloading part which ending with "All".
sheetnames = { 'MATLAB Ana00 ALL', 'MATLAB Ana01 ALL','MATLAB Ana02 ALL','MATLAB Ana03 ALL', 'MATLAB Ana04 ALL', 'MATLAB Ana05 ALL', 'MATLAB Ana06 ALL', 'MATLAB Ana07 ALL', 'MATLAB Ana08 ALL' };
1- I need to bring it to MATLAB then plot those sheets curves that ending with "All" each sheet as one curve (loading and unloading). which ends with 8 subplots graphs of 10 curves each.
The current code gives me only all curves in one plot of (loading and unloading)graph. I need make as 8 subplot graphs.
2- Store the loading part from the first 8 sheets into MATLAB for further calculation.
sheetnames = { 'MATLAB Ana00', 'MATLAB Ana01','MATLAB Ana02','MATLAB Ana03', 'MATLAB Ana04', 'MATLAB Ana05', 'MATLAB Ana06', 'MATLAB Ana07', 'MATLAB Ana08' };
The code is:
filename = 'Data Cell_060517.xlsx';
% %Shee Number
sheetnames = { 'MATLAB Ana00 ALL', 'MATLAB Ana01 ALL','MATLAB Ana02 ALL','MATLAB Ana03 ALL', 'MATLAB Ana04 ALL', 'MATLAB Ana05 ALL', 'MATLAB Ana06 ALL', 'MATLAB Ana07 ALL', 'MATLAB Ana08 ALL' };
xlRange = { 'A3:B3992', 'E3:F3992', 'I3:J3992', 'M3:N3992', 'Q3:R3992', 'U3:V3992', 'Y3:Z3992', 'AC3:AD3992','AG3:AH3992', 'AK3:AL3992' };
n = length(sheetnames);
m = length(xlRange);
hold on
a=zeros(1,1);
for idx = 1:n
idx
figure
for idl = 1:m
idl
a = xlsread(filename,sheetnames{idx},xlRange{idl});
z_app=a(:,1);
d_app=a(:,2);
plot (z_app,d_app);
xlabel('z_app'), ylabel('d_app')
title('loadind & unloading')
end
end
0 commentaires
Réponses (0)
Voir également
Catégories
En savoir plus sur Instrument Control Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!