Plot several signals but I want nudging or not overlap between them
Show older comments
Hello,
I have ERG responses, different traces to graph in a Excel file. I have the time in seconds and in different sheets the data for 10 different intensities. I want to graphs all the intensities in the same plot, but they overlap. I want to put offset or a nudging but I can´t make it work. Here is the code I run.
filename = 'C:\Users\Milagros\Desktop\24 Hs\meangraphs.xls';
time = xlsread(filename,1,'A1:A512');
y1 = xlsread(filename,2,'A1:A512');
y2 = xlsread(filename,2,'B1:B512');
y3 = xlsread(filename,2,'C1:C512');
y4 = xlsread(filename,2,'D1:D512');
y5 = xlsread(filename,2,'E1:E512');
y6 = xlsread(filename,2,'F1:F512');
y7 = xlsread(filename,2,'G1:G512');
y8 = xlsread(filename,2,'H1:H512');
y9 = xlsread(filename,2,'I1:I512');
y10 = xlsread(filename,2,'J1:J512');
hold on
plot(time,[y1,y2,y3,y4,y5,y6,y7,y8,y9,y10]);
hold off
What I get in fig 1 and what I want is in fig 2.
2 Comments
You didn't ask for it, but you could probably make your life easier if you store the data in a single variable
ranges = 'A':'J';
for i=1:numel(ranges)
range = sprintf('%c1:%c512', ranges(i), ranges(i));
Y(:,i) = xlsread(filename,2,range);
end
Milagros ARIETTI
on 26 Nov 2015
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!

