How do I make a probability plot of ranges of values below a certain threshold?
Show older comments
I plotted a yearly wind profile and calculated that the maximum consecutive hours below a threshold of 3 m/s is 43h. For this I used the code below. Now I want to know often this time period of 43h occurs and how often 42h, 41h, 40h,...,1h occur. For that reason I want to make a distribution plot of every time period up to 43h on the x-axis and the % of time it occurs on the y-axis, but how?
You can find the wind speed profile below.
%Data import
Windspeed_hourly_mean = xlsread('Windspeed_hourly.xlsx','B2:B8763');
WHM=Windspeed_hourly_mean;
%Parameters
threshold = 3;
windHeight = 50;
hubHeight = 150;
%Windspeed calculation at hub height
wind60 = WHM .* log(60/0.0001) ./ log(windHeight/0.0001);
windHub = wind60 .* (hubHeight ./ 60) .^ 0.115;
isBelow = (windHub < threshold); % gives us a vector of logical values
isBelow = [false; isBelow; false]; % make sure the vector starts and ends with false
transitions = diff(isBelow); % gives 1 where false->true and -1 where true->false
starts = find(transitions==1); % indexes of where each period starts
ends = find(transitions==-1); % indexes of where each period ends
durations = ends - starts;
max(durations); % largest duration
t_delta = max(durations)
plot(windHub,'b')

Accepted Answer
More Answers (0)
Categories
Find more on Exploration and Visualization 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!