I have troubles with my axis. (hold on)

1 次查看(过去 30 天)
Why does my axis-limits are changing. Because i have it already stored. Thank you.
The Problem is at the end of my Code:
if counterx==1
subplot(1,2,1) %positioniert bei 1
hold on
end
Here is my Code:
%Allgemeine Initalsierungen
r_inputdataSigmaX=[;];
r_inputdataSigmaY=[;];
r_inputdataTau=[;];
w_inputdataTau=[;];
w_inputdataSigmaY=[;];
w_inputdataSigmaX=[;];
cuttofflinesSigmaX=[;];
cuttofflinesSigmaY=[;];
cuttofflinesTau=[;];
r_inputdata_logic=zeros(1,3);
w_inputdata_logic=zeros(1,3);%[0;0;0]; %zeros(m,n)
inputdata_cuttofflines_logic=zeros(1,3);%[0;0;0];
default_value_z=1e8; %hier setze defaultmässig die z Komponente/Wert der Cutofflinien
row1=0;
row2=0;
row3=0;
index_counter=1;
t=0;
%Einlese Prozedere
wholecontent = fileread('MatlabExport_SigX_RF.txt')
sections = regexp(wholecontent, '\*+([^*]+)\*+([^*]+)', 'tokens')
for section = sections
switch(strtrim(section{1}{1}))
case 'Plot Page Options and Settings'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
plotpageSettings = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Die Diagram Options gelten jeweils für rainflow und woehler
case 'Diagram Options SigmaX'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
diagramoptionsSigmaX = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
case 'Diagram Options SigmaY'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
diagramoptionsSigmaY = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
case 'Diagram Options Tau'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
diagramoptionsTau = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'Woehler Lines SigmaX'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
w_diagramoptionsSigmaX = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
w_inputdata_logic(1,1) = 1;
case 'Woehler Lines SigmaY'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
w_diagramoptionsSigmaY = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
w_inputdata_logic(1,2) = 1;
case 'Woehler Lines Tau'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
w_diagramoptionsTau = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
w_inputdata_logic(1,3) = 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'Rainflow Options SigmaX'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
r_diagramoptionsSigmaX = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
case 'Rainflow Options SigmaY'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
r_diagramoptionsSigmaY = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
case 'Rainflow Options Tau'
keyvalues = regexp(section{1}{2}, '([^\n\r=]+)=([^\n\r=]+)', 'tokens')
r_diagramoptionsTau = cell2table(vertcat(keyvalues{:}), 'VariableNames', {'Key', 'Value'})
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'Rainflow Cutofflines SigmaX'
cuttofflinesSigmaX = cell2mat(textscan(section{1}{2}, '%f%f', 'HeaderLines', 1))
inputdata_cuttofflines_logic(1,1) = 1;
case 'Rainflow Cutofflines SigmaY'
cuttofflinesSigmaY = cell2mat(textscan(section{1}{2}, '%f%f', 'HeaderLines', 1))
inputdata_cuttofflines_logic(1,2) = 1;
case 'Rainflow Cutofflines Tau'
cuttofflinesTau = cell2mat(textscan(section{1}{2}, '%f%f', 'HeaderLines', 1))
inputdata_cuttofflines_logic(1,3) = 1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'StressSpectrum Data SigmaX'
w_inputdataSigmaX = cell2mat(textscan(section{1}{2}, '%f%f', 'HeaderLines', 1))
case 'StressSpectrum Data SigmaY'
w_inputdataSigmaY = cell2mat(textscan(section{1}{2}, '%f%f', 'HeaderLines', 1))
case 'StressSpectrum Data Tau'
w_inputdataTau = cell2mat(textscan(section{1}{2}, '%f%f', 'HeaderLines', 1))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
case 'Rainflow Data SigmaX'
r_inputdataSigmaX = cell2mat(textscan(section{1}{2}, '%f%f%f', 'HeaderLines', 1))
r_inputdata_logic(1,1) = 1;
case 'Rainflow Data SigmaY'
r_inputdataSigmaY = cell2mat(textscan(section{1}{2}, '%f%f%f', 'HeaderLines', 1))
r_inputdata_logic(1,2) = 1;
case 'Rainflow Data Tau'
r_inputdataTau = cell2mat(textscan(section{1}{2}, '%f%f%f', 'HeaderLines', 1))
r_inputdata_logic(1,3) = 1;
otherwise
warning('Unknown section ERROR: %s', section{1}{1})
end
end
%Alle 6 Diagramme werden dargestellt...
if sum(w_inputdata_logic)==3 && sum(r_inputdata_logic)==3
counterx=6;
plotPositions = [ 3, 21, 8, 8;
12, 21, 8, 8;
3, 12, 8, 8;
12, 12, 8, 8;
3, 3, 8, 8;
12, 3, 8, 8];
new_plotPositions = plotPositions(1:counterx,1:4);
end
%Nur eine Reihe wird dargestellt
if sum(w_inputdata_logic)==1 && sum(r_inputdata_logic)==1
counterx=2;
plotPositions = [ 3, 21, 8, 8; 12, 21, 8, 8];
new_plotPositions = plotPositions(1:counterx,1:4);
end
%Nur ein Bild wird dargestellt
if sum(w_inputdata_logic)==1 && sum(r_inputdata_logic)==0 || sum(w_inputdata_logic)==0 && sum(r_inputdata_logic)==1
counterx=1;
new_plotPositions = [ 3, 3, 21, 21]
end
%Aufbereiten aller Diagramme
fig = figure('Name','Page Header','Color',[1 1 0.9]);
fig.Units = 'centimeters';
fig.Position(3:4) = [30 30];
nPlots=length(new_plotPositions);
hAx=zeros(nPlots,1);
%Page Header -> Ganze Seite
pageHeader=plotpageSettings.Value(strcmp(plotpageSettings.Key, 'pageheader'))
annotation(fig,'textbox',...
[0.0166903765690328 0.961151079136691 0.275150627615067 0.050359712230215],...
'String',pageHeader,...
'FontSize',20,...
'FitBoxToText','off',...
'EdgeColor','none');
for i = 1:size(new_plotPositions,1);
%1 Diagramm
if counterx==1
plotHandle = subplot(1, 1, i);
m=1;
n=1;
hAx(i)=subplot(1, 1, i);
if w_inputdata_logic(1,1)==1 %Diagram 2
diagramheader=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_diagramheaderSigmaX'))
labelabscissa=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_labelabscissaSigmaX'))
labelordinate=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_labelordinateSigmaX'))
ordinateLogarithmic=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_abscissaMinSigmaX')))
abscissaMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_abscissaMaxSigmaX')))
ordinateMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateMinSigmaX')))
ordinateMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateMaxSigmaX')))
equivcycles=str2double(w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionlinestyle')});
wsectionslope = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionslope')}));
equilabel = w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'cutoffvalue')}));
end
if w_inputdata_logic(1,2)==1 %Diagram 4
diagramheader=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_diagramheaderSigmaY'))
labelabscissa=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_labelabscissaSigmaY'))
labelordinate=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_labelordinateSigmaY'))
ordinateLogarithmic=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_abscissaMinSigmaY')))
abscissaMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_abscissaMaxSigmaY')))
ordinateMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateMinSigmaY')))
ordinateMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateMaxSigmaY')))
equivcycles=str2double(w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionlinestyle')});
wsectionslope = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionslope')}));
equilabel = w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'cutoffvalue')}));
end
if w_inputdata_logic(1,3)==1 %Diagram 6
diagramheader=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_diagramheaderTau'))
labelabscissa=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_labelabscissaTau'))
labelordinate=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_labelordinateTau'))
ordinateLogarithmic=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_abscissaMinTau')))
abscissaMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_abscissaMaxTau')))
ordinateMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateMinTau')))
ordinateMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateMaxTau')))
equivcycles=str2double(w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionlinestyle')});
equilabel = w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'cutoffvalue')}));
end
if r_inputdata_logic(1,1)==1 %Diagram 1
diagramheader=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_diagramheaderSigmaX'))
labelabscissa=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_labelabscissaSigmaX'))
labelordinate=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_labelordinateSigmaX'))
ordinateLogarithmic=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_ordinateLogarithmic'))%%%%%%%%%
abscissaMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_abscissaMinSigmaX')))
abscissaMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_abscissaMaxSigmaX')))
ordinateMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_ordinateMinSigmaX')))
ordinateMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_ordinateMaxSigmaX')))
end
if r_inputdata_logic(1,2)==1 %Diagram 3
diagramheader=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_diagramheaderSigmaY'))
labelabscissa=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_labelabscissaSigmaY'))
labelordinate=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_labelordinateSigmaY'))
ordinateLogarithmic=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_ordinateLogarithmic'))%%%%%%%%%
abscissaMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_abscissaMinSigmaY')))
abscissaMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_abscissaMaxSigmaY')))
ordinateMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_ordinateMinSigmaY')))
ordinateMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_ordinateMaxSigmaY')))
end
if r_inputdata_logic(1,3)==1 %Diagram 5
diagramheader=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_diagramheaderTau'))
labelabscissa=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_labelabscissaTau'))
labelordinate=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_labelordinateTau'))
ordinateLogarithmic=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_ordinateLogarithmic'))%%%%%%%%%
abscissaMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_abscissaMinTau')))
abscissaMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_abscissaMaxTau')))
ordinateMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_ordinateMinTau')))
ordinateMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_ordinateMaxTau')))
end
end
%Eine Reihe
if counterx==2
plotHandle = subplot(2, 2, i);%Ein Subplot mit 2 Diagrammen wird erstellt
m=2;
n=1;
hAx(i)=subplot(2, 2, i);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if r_inputdata_logic(1,1)==1 && row1==0 %Diagram 1
diagramheader=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_diagramheaderSigmaX'))
labelabscissa=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_labelabscissaSigmaX'))
labelordinate=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_labelordinateSigmaX'))
abscissaMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_abscissaMinSigmaX')))
abscissaMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_abscissaMaxSigmaX')))
ordinateMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_ordinateMinSigmaX')))
ordinateMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_ordinateMaxSigmaX')))
row1=1
logical_1=0;
end
if r_inputdata_logic(1,2)==1 && row2==0 %Diagram 3
diagramheader=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_diagramheaderSigmaY'))
labelabscissa=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_labelabscissaSigmaY'))
labelordinate=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_labelordinateSigmaY'))
abscissaMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_abscissaMinSigmaY')))
abscissaMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_abscissaMaxSigmaY')))
ordinateMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_ordinateMinSigmaY')))
ordinateMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_ordinateMaxSigmaY')))
row2=1;
logical_1=0;
end
if r_inputdata_logic(1,3)==1 && row3==0 %Diagram 5
diagramheader=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_diagramheaderTau'))
labelabscissa=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_labelabscissaTau'))
labelordinate=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_labelordinateTau'))
abscissaMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_abscissaMinTau')))
abscissaMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_abscissaMaxTau')))
ordinateMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_ordinateMinTau')))
ordinateMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_ordinateMaxTau')))
row3=1
logical_1=0;
end
if w_inputdata_logic(1,1)==1 && logical_1==1%Diagram 2
diagramheader=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_diagramheaderSigmaX'))
labelabscissa=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_labelabscissaSigmaX'))
labelordinate=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_labelordinateSigmaX'))
ordinateLogarithmic=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_abscissaMinSigmaX')))
abscissaMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_abscissaMaxSigmaX')))
ordinateMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateMinSigmaX')))
ordinateMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateMaxSigmaX')))
equivcycles=str2double(w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionlinestyle')});
wsectionslope = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionslope')}));
equilabel = w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'cutoffvalue')}));
end
if w_inputdata_logic(1,2)==1 && logical_1==1 %Diagram 4
diagramheader=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_diagramheaderSigmaY'))
labelabscissa=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_labelabscissaSigmaY'))
labelordinate=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_labelordinateSigmaY'))
ordinateLogarithmic=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_abscissaMinSigmaY')))
abscissaMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_abscissaMaxSigmaY')))
ordinateMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateMinSigmaY')))
ordinateMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateMaxSigmaY')))
equivcycles=str2double(w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionlinestyle')});
wsectionslope = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionslope')}));
equilabel = w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'cutoffvalue')}));
end
if w_inputdata_logic(1,3)==1 && logical_1==1 %Diagram 6
diagramheader=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_diagramheaderTau'))
labelabscissa=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_labelabscissaTau'))
labelordinate=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_labelordinateTau'))
ordinateLogarithmic=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_abscissaMinTau')))
abscissaMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_abscissaMaxTau')))
ordinateMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateMinTau')))
ordinateMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateMaxTau')))
equivcycles=str2double(w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionlinestyle')});
equilabel = w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'cutoffvalue')}));
end
logical_1=1;
end
%Alle Diagramme
if counterx==6
plotHandle = subplot(3, 2, i);
m=2;
n=3;
hAx(i)=subplot(3, 2, i);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if w_inputdata_logic(1,1)==1 && i==2%Diagram 2
diagramheader=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_diagramheaderSigmaX'))
labelabscissa=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_labelabscissaSigmaX'))
labelordinate=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_labelordinateSigmaX'))
ordinateLogarithmic=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_abscissaMinSigmaX')))
abscissaMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_abscissaMaxSigmaX')))
ordinateMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateMinSigmaX')))
ordinateMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'w_ordinateMaxSigmaX')))
equivcycles=str2double(w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionlinestyle')});
wsectionslope = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'wsectionslope')}));
equilabel = w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsSigmaX.Value(strcmp(w_diagramoptionsSigmaX.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsSigmaX.Value{strcmp(w_diagramoptionsSigmaX.Key, 'cutoffvalue')}));
end
if w_inputdata_logic(1,2)==1 && i==4 %Diagram 4
diagramheader=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_diagramheaderSigmaY'))
labelabscissa=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_labelabscissaSigmaY'))
labelordinate=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_labelordinateSigmaY'))
ordinateLogarithmic=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_abscissaMinSigmaY')))
abscissaMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_abscissaMaxSigmaY')))
ordinateMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateMinSigmaY')))
ordinateMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'w_ordinateMaxSigmaY')))
equivcycles=str2double(w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionlinestyle')});
wsectionslope = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'wsectionslope')}));
equilabel = w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsSigmaY.Value(strcmp(w_diagramoptionsSigmaY.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsSigmaY.Value{strcmp(w_diagramoptionsSigmaY.Key, 'cutoffvalue')}));
end
if w_inputdata_logic(1,3)==1 && i==6 %Diagram 6
diagramheader=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_diagramheaderTau'))
labelabscissa=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_labelabscissaTau'))
labelordinate=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_labelordinateTau'))
ordinateLogarithmic=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateLogarithmic'))
abscissaMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_abscissaMinTau')))
abscissaMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_abscissaMaxTau')))
ordinateMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateMinTau')))
ordinateMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'w_ordinateMaxTau')))
equivcycles=str2double(w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equivcycles')))
equivstress=str2double(w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equivstress')))
wsectionstart = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionstart')}));
wsectionsend = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionsend')}));
wsectionstartstress = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionstartstress')}));
wsectionlinestyle = strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'wsectionlinestyle')});
equilabel = w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'equilabel'))
spectrmaxlabel = w_diagramoptionsTau.Value(strcmp(w_diagramoptionsTau.Key, 'spectrmaxlabel'))
cutoffvalue = str2double(strsplit(w_diagramoptionsTau.Value{strcmp(w_diagramoptionsTau.Key, 'cutoffvalue')}));
end
if r_inputdata_logic(1,1)==1 && i==1 %Diagram 1
diagramheader=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_diagramheaderSigmaX'))
labelabscissa=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_labelabscissaSigmaX'))
labelordinate=diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_labelordinateSigmaX'))
abscissaMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_abscissaMinSigmaX')))
abscissaMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_abscissaMaxSigmaX')))
ordinateMin=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_ordinateMinSigmaX')))
ordinateMax=str2double(diagramoptionsSigmaX.Value(strcmp(diagramoptionsSigmaX.Key, 'r_ordinateMaxSigmaX')))
end
if r_inputdata_logic(1,2)==1 && i==3 %Diagram 3
diagramheader=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_diagramheaderSigmaY'))
labelabscissa=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_labelabscissaSigmaY'))
labelordinate=diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_labelordinateSigmaY'))
abscissaMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_abscissaMinSigmaY')))
abscissaMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_abscissaMaxSigmaY')))
ordinateMin=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_ordinateMinSigmaY')))
ordinateMax=str2double(diagramoptionsSigmaY.Value(strcmp(diagramoptionsSigmaY.Key, 'r_ordinateMaxSigmaY')))
end
if r_inputdata_logic(1,3)==1 && i==5 %Diagram 5
diagramheader=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_diagramheaderTau'))
labelabscissa=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_labelabscissaTau'))
labelordinate=diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_labelordinateTau'))
abscissaMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_abscissaMinTau')))
abscissaMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_abscissaMaxTau')))
ordinateMin=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_ordinateMinTau')))
ordinateMax=str2double(diagramoptionsTau.Value(strcmp(diagramoptionsTau.Key, 'r_ordinateMaxTau')))
end
end
plotHandle.Units = 'centimeters';
plotHandle.Position = new_plotPositions(i,:);
box(subplot(n, m, i),'on');
hAx(i)=subplot(n, m, i);
axis(hAx(i),[ abscissaMin abscissaMax ordinateMin ordinateMax]);
set(subplot(n,m, i),'FontAngle','italic');
set(subplot(n, m, i),'FontSize',11);
set(subplot(n, m, i),'FontWeight','bold');
set(subplot(n, m, i),'XMinorTick','on');
set(subplot(n, m, i),'XGrid','on');
set(subplot(n, m, i),'YGrid','on');
set(subplot(n, m, i),'YScale','linear');
set(subplot(n, m, i),'XColor',[0 0 0]);
set(subplot(n, m, i),'YColor',[0 0 0]);
%Diagram Title, x/y-Label, logarithmic***************
title1=subplot(n, m, i)
title(title1,diagramheader)
labelabscissa1=subplot(n, m, i)
labelordinate1=subplot(n, m, i)
if i==2 || i==4 || i==6 || counterx==1
logarithmic1=subplot(n, m, i)
bool = strcmp(ordinateLogarithmic,'true')
if bool==1
logarithmic='log'
set(subplot(n, m, i),'XScale',logarithmic);
else
logarithmic='linear'
set(subplot(n, m, i),'XScale',logarithmic);
end
end
xlabel(labelabscissa1,labelabscissa);
ylabel(labelordinate1,labelordinate);
hold on
%**************************************************
% TextH = text(1, 1, 'dummy3', ...
% 'Units', 'normalized', ...
% 'VerticalAlignment', 'top', ...
% 'HorizontalAlignment', 'right');
end
% Create textbox
% annotation(fig,'textbox',...
% [0.550163179916317 0.143884892086331 0.25736820083682 0.166906474820144],...
% 'FitBoxToText','off');
% Create textbox
pageHeader=plotpageSettings.Value(strcmp(plotpageSettings.Key, 'pageheader'))
annotation(fig,'textbox',...
[0.0166903765690328 0.961151079136691 0.275150627615067 0.050359712230215],...
'String',pageHeader,...
'FontSize',20,...
'FitBoxToText','off',...
'EdgeColor','none');
hold on;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Rainflow******************************************************************
%Ich lese mit AA, BB und CC die Zeilenanzahl der jeweiligen Matrizen aus
[row_count_SigmaX,r]=size(r_inputdataSigmaX);
[row_count_SigmaY,e]=size(r_inputdataSigmaY);
[row_count_Tau,f]=size(r_inputdataTau);
row_maximum=row_count_SigmaX;%defaultmässig
matrix_reference=r_inputdataSigmaX % defaultmässig
if row_count_SigmaX<row_count_SigmaY
row_maximum=row_count_SigmaY;
matrix_reference=r_inputdataSigmaY
end
if row_count_Tau>row_maximum
row_maximum=row_count_Tau;
matrix_reference=r_inputdataTau
end
%Aufblasen der Matrix auf die benötigte Größe
if row_count_SigmaX < row_maximum
%if row_count_SigmaX
ref=zeros(row_maximum-size(r_inputdataSigmaX,1),3)
r_inputdataSigmaX = vertcat(r_inputdataSigmaX,ref)
%end
end
if row_count_SigmaY<row_maximum
%if row_count_SigmaY>0
ref=zeros(row_maximum-size(r_inputdataSigmaY,1),3)
r_inputdataSigmaY = vertcat(r_inputdataSigmaY,ref)
%end
end
if row_count_Tau<row_maximum
%if row_count_Tau>0
ref=zeros(row_maximum-size(r_inputdataTau,1),3)
r_inputdataTau = vertcat(r_inputdataTau,ref)
%end
end
input_data_rainflow=horzcat(r_inputdataSigmaX,r_inputdataSigmaY,r_inputdataTau);%ich füge hier alle Rainflow Daten Vertikal zusammen
%Die Rainflow Daten wurden soeben ausgelesen
%**************************************************************************
%Cutofflines***************************************************************
[row_count_SigmaX,r]=size(cuttofflinesSigmaX);
[row_count_SigmaY,e]=size(cuttofflinesSigmaY);
[row_count_Tau,f]=size(cuttofflinesTau);
row_maximum=row_count_SigmaX;%defaultmässig
matrix_reference=cuttofflinesSigmaX%defaultmässig
if row_count_SigmaX<row_count_SigmaY
row_maximum=row_count_SigmaY;
matrix_reference=cuttofflinesSigmaY
end
if row_count_Tau>row_maximum
row_maximum=row_count_Tau;
matrix_reference=cuttofflinesTau
end
%Aufblasen der Matrix auf die benötigte Größe
if row_count_SigmaX < row_maximum
ref=zeros(row_maximum-size(cuttofflinesSigmaX,1),2)
cuttofflinesSigmaX = vertcat(cuttofflinesSigmaX,ref)
end
if row_count_SigmaY<row_maximum
ref=zeros(row_maximum-size(cuttofflinesSigmaY,1),2)
cuttofflinesSigmaY = vertcat(cuttofflinesSigmaY,ref)
end
if row_count_Tau<row_maximum
ref=zeros(row_maximum-size(cuttofflinesTau,1),2)
cuttofflinesTau = vertcat(cuttofflinesTau,ref)
end
input_data_cutofflines=horzcat(cuttofflinesSigmaX,cuttofflinesSigmaY,cuttofflinesTau);%ich füge hier alle Rainflow Daten Vertikal zusammen
%Cutofflines/Rainflowdaten wurden gespeichert -> linke Seite
%Jetzt werden die Diagramme (Rainflow und deren Cutofflines geplottet)
%Cutofflines haben immer 6 Spalten, Rainflow Daten immer 9 Spalten
for i=1:3%läuft drei Mal durch.
%Auslese Alg.(wichtig)für Cutofflines & Rainflow Daten
if i==1
counter=0;
counter1=0;
else
counter=counter+3;
counter1=counter1+2;
end
%Auslesen der Rainflow Daten:
x = input_data_rainflow(:,1+counter)
y = input_data_rainflow(:,2+counter)
z = input_data_rainflow(:,3+counter)
%Grösser? Rainflow oder Cutoff?
% az = 0;
% el = 90;
% view(az, el);
% hold on
% view(0,90)
% a = 12;
%Alg. für das Plotten für 6 Diag.
if sum(x)==0 && sum(y)==0 && sum(z)==0
plot_pos=1
else
plot_pos=1+counter1;
end
%Auslesen der Cutofflinien:
xx = input_data_cutofflines(:,1+counter1)%ich lese hier die x-Werte aller Punkte aus
yy = input_data_cutofflines(:,2+counter1)%ich lese hier die y-Werte aller Punkte aus
Size_cutofflines=[row_count_SigmaX;row_count_SigmaY;row_count_Tau]
%Hier schaue ich wie gross die Cutofflines wirklich sind.
%if row_count_SigmaX~=0 || row_count_SigmaY~=0 || row_count_Tau~=0
if sum(xx)~=0 && sum(yy)~=0 %Hier erfolgt die generelle Abfrage ob es existent ist
for index = 1:Size_cutofflines(index_counter)%Er macht nur die Größe vom orig. Array
if (index==1)%erster Durchlauf
line([xx(index) xx(index+1)],[yy(index) yy(index+1)],[default_value_z default_value_z],'Marker','.','LineStyle','-','LineWidth',5, 'Color',[1 1 0]);
else
line([xx(index-1) xx(index)],[yy(index-1) yy(index)],[default_value_z default_value_z],'Marker','.','LineStyle','-','LineWidth',5, 'Color',[1 0 0]);
end
if counterx==1 %sum(xx)~=0 && sum(yy)~=0
subplot(1,2,1) %positioniert bei 1
hold on
end
if counterx==2% && sum(xx)~=0 && sum(yy)~=0
subplot(2,2,1) %positioniert bei 1
hold on
end
if counterx==6 %sum(xx)~=0 && sum(yy)~=0
subplot(3,2,plot_pos)%positioniert bei 1 / 3 / 5 je nach durchlauf
hold on
end
end
end
index_counter=index_counter+1;
%Hier wird der Rainflow geplottet falls das Datensatz nicht null ist
if sum(x)~=0 && sum(y)~=0 && sum(z)~=0
az = 0;
el = 90;
view(az, el);
hold on
view(0,90)
a = 12;
scatter3(x, y, z, a, z, 'filled')
hold on
view(0, 90)
[m,ind]=max(z);
colorbar
scatter3(x(ind), y(ind), z(ind),'*r');
grid on;
hold on;% kann man hier nicht hold off
end
end
Input:
********************Plot Page Options and Settings******
pageheader=Sigma_x, Rainflow-Matrix
*******************Diagram Options SigmaX************
r_diagramheaderSigmaX=Rainflow-Matrix
r_labelordinateSigmaX=Amplitude
r_labelabscissaSigmaX=Mittelwert
r_abscissaMinSigmaX=131.95
r_abscissaMaxSigmaX=391.95
r_ordinateMinSigmaX=0
r_ordinateMaxSigmaX=260
*******************Rainflow Data SigmaX************
256.1 226.2 0
256.1 226.2 50053
253.5 218.4 50053
252.2 169 50053
217.75 162.5 50053
245.7 150.8 50053
256.75 149.5 50053
287.95 149.5 50053
295.75 141.7 50053
214.5 140.4 50053
246.35 139.1 50053
237.9 85.8 50053
273 85.8 50053
*******************Rainflow Cutofflines SigmaX************
-16.877365003178 33.7547300063561
-16.877365003178 29.6498627322981
14.8249313661491 29.6498627322981
14.8249313661491 28.4479694352974
  1 个评论
Adam
Adam 2017-4-5
You need to give more information on what the symptoms are and, if possible, try to replicate the problem in a much simpler example because that is a lot of code that no-one will easily be able to skim through.
One thing I tell everyone who posts similar code though is:
Don't use things like just
hold on
Always use explicit axes handles for plot-related instructions e.g.
hold( hAxes, 'on' )
plot( hAxes, xData, yData,... )
etc. It avoids so many odd bits of behaviour that come from just assuming that the current axes will be fine for the next instruction.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Vibration Analysis 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by