The Cycle 2 Separation looks like
g2=Cycle1DownStop;
Cycle2UpStop=Cycle1DownStop;
A2=[5 5];
while (A2(1,1)>-0.0001) & (AverageStrain(g2,1)<0.35)
h2 = AverageStrain(1+g2:20+g2,:);
i2 = AverageStress(1+g2:20+g2,:);
A2 = polyfit(h2,i2,1);
Cycle2UpStop = g2+10;
g2 = g2+20;
end
Cycle2UpStrain=AverageStrain(Cycle1DownStop:Cycle2UpStop,1);
Cycle2UpStress=AverageStress(Cycle1DownStop:Cycle2UpStop,1);
The code then plots the Cycle2UpStrain vs Cycle2UpStress. Note that it looks like h2 and i2 data are populated with 20 elements each, the polyfit is executed and the end point, Cycle2UpStop is set, and g2 is incremented for the next iteration. Note the differences between these last two statements
Cycle2UpStop = g2+10;
g2 = g2+20;
The 20 makes sense for g2 since we seem to want to extract 20 distinct elements from the AverageStrain and AverageStress on each iteration. So why is the same not done for Cycle2UpStop? As we have already extracted data from 1+g2:20+g2 then it seems that we should want
Try that and see what happens!
Best Answer