What's the best plot for load spectrums?

Hey everybody!
I want to plot a typical load spectrum for reliability purpose. In this example I have 20 different load classes of a temperature load.
Since load spectrums usually have rectangular "steps" I tried the stairs-plot but I only managed the following plot:
It looks quite alright, but unfortunatly the plot lines in the 20th class should go horizontaly all the way to the y-axis.
My Code looks like this:
stairs(az(end:-1:1),1:x, 'color', 'k')
ylim([1 x+1])
grid on
set(gca, 'XScale', 'log')
hold on %I'm plotting in a for-loop
xlabel('Time [h]')
ylabel('Temperature Classes [-]')
title('Load Collective ')
x: Amount of classes
az: array of hours
Data:
x= 1:20;
az= [265,578,983,1479,2060,2728,3440,4175,4842,5446,6029,6597,7112,7579,7960,8270,8510,8665,8738,8759];
I counted 'az' backwards so that the 20th element of 'az' is connected to the class 20.
Does anyone have experience in plotting load spectrums of rainflow or dwell time data? Or does someone have an improvement of my code?
Your help is much appreciated, thank you!

3 Kommentare

Mathieu NOE
Mathieu NOE am 19 Apr. 2022
hello
maybe it would be usefull to share some data as well
tx
Yannick Braun
Yannick Braun am 19 Apr. 2022
yes of course, I'll edit the question.
well , I prefered to flip x instead of az
and I think the plot is now ok
x= 20:-1:1;
az= [265,578,983,1479,2060,2728,3440,4175,4842,5446,6029,6597,7112,7579,7960,8270,8510,8665,8738,8759];
% stairs(az(end:-1:1),x, 'color', 'k','linewidth',5)
stairs(az,x, 'color', 'k','linewidth',5)
grid on
set(gca, 'XScale', 'log')
hold on %I'm plotting in a for-loop
xlabel('Time [h]')
ylabel('Temperature Classes [-]')
title('Load Collective ')

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte

Version

R2021b

Gefragt:

am 18 Apr. 2022

Kommentiert:

am 19 Apr. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by