How to find the average peak values and plot?
Show older comments
Hi,
I got the attached plot from the code below. I would like to start the graph from 0.3 instead of 0 (y-axis) and then do the average of peaks. Average peaks should be like: average of first and second peak, then average of second and third peak and so on. Then plot them like the attached figure but with the average peak values. I would really apprecite if someone help me with that?

m=1000;
I1=0.5;
I2=0.3;
I3=0.2;
L1=70*m;
L2=140*m;
n1=2;
n2=1.444;
index=n2;
lam=m*(1.5:0.000001:1.6);
Q12=(4*pi*n1*L1)./lam;
Q23=(4*pi*n2*L2)./lam;
Q13=Q12+Q23;
I=I1+I2+I3+2*sqrt(I1*I2).*cos(Q12)+2*sqrt(I2*I3).*cos(Q23)+2*sqrt(I1*I3).*cos(Q13);
plot(lam,I);
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots 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!