本文共 1796 字,大约阅读时间需要 5 分钟。
Matlab的.m程序,一键提取滞回曲线的骨架曲线点
-----------------------------
[ColMaxValue,LineMax]=max(A); %获取各列最大值所在行号LineMax(1*n向量),ColMaxValue为各列的最大值(1*n向量),n为A的列数
[ColMinValue,LineMin]=min(A); %获取各列最小值所在行号LineMin
FramePointMax=A(LineMax(2),:); %第2列为荷载列
FramePointMin=A(LineMin(2),:);
FramePointsPostive(k,:)=FramePointMax; %骨架曲线点储存在矩阵FramePoints中
FramePointsNegative(k,:)=FramePointMin;
elseif outdata(LineNum,1)>=0 %仅正半周,仅一个最大值----------------------------------------------------
[ColMaxValue,LineMax]=max(A); %获取最大值行号LineMax
FramePointMax=A(LineMax(2),:);
FramePointsPostive(k,:)=FramePointMax;
else %有负半周,有最大值和最小值----------------------------------------------------
[ColMinValue,LineMin]=min(A); %获取最小值行号LineMin
FramePointMin=A(LineMin(2),:);
FramePointsPostive(k,:)=FramePointMax;
FramePointsNegative(k,:)=FramePointMin;
end;
end;
end;
%---------------------------------------比较最大位移,删除骨架曲线中同一荷载级的较小骨架点---------------------------------------------------
for k=LoopNum:-1:2
A=LoopCircles{k};
B=LoopCircles{k-1};
[ColMaxValueA,LineMaxA]=max(A); %获取各列最大值所在行号LineMax(1*n向量),ColMaxValue为各列的最大值(1*n向量),n为A的列数
[ColMinValueA,LineMinA]=min(A); %获取各列最小值所在行号LineMin
[ColMaxValueB,LineMaxB]=max(B); %获取各列最大值所在行号LineMax(1*n向量),ColMaxValue为各列的最大值(1*n向量),n为A的列数
[ColMinValueB,LineMinB]=min(B); %获取各列最小值所在行号LineMin
if abs(ColMaxValueA(1)-ColMaxValueB(1))<4; %判断为同一荷载级,容差取为4mm
if ColMaxValueA(2)
FramePointsPostive(k,:)=[];
else
FramePointsPostive(k-1,:)=[];
end;
end;
if abs(ColMinValueA(1)-ColMinValueB(1))<4;
if ColMinValueA(2)
FramePointsNegative(k-1,:)=[];
else
FramePointsNegative(k,:)=[];
end;
end;
end;
dlmwrite('FrameCurve.txt',FramePointsPostive,'-append','delimiter','\t','
newline','pc','precision','%.2f')
dlmwrite('FrameCurve.txt',FramePointsNegative,'-append','delimiter','\t','newline','pc','precision','%.2f')
转载地址:http://knncl.baihongyu.com/