- The plot is missing the vertical lines to separate the regions
- The plot doesn't have the region labels
Mode identification on a Graph.
1 view (last 30 days)
mpho bosupeng on 24 Apr 2021
I am a beginner with MATLAB and i need some assistance. I need to produce a graph similar to this one attached. I want to include the vertical dotted lines and the labelling on the graph (HF, IF, AND Trend). My question is how to I do this, I only know that this will need some threshold.
Clayton Gotberg on 24 Apr 2021
It looks like you already have the code to find out where the divisions should be. In that case, all that remains to be solved is:
HF_IF_divider = ; % this value should be the point in x at which the HF and IF regions touch
IF_Trend_divider = ; % this value should be the point in x where IF and Trend meet
plot(data) % replace with all of the plotting you've done so far
% Add the vertical lines
xline(HF_IF_divider,'k--') % Thanks @Adam Danz for mentioning this great function
xline(IF_Trend_divider,'k--') % 'k' means black lines, '--' means dashed lines
label_x = [1/2*HF_IF_divider, 1/2*(IF_Trend_divider+HF_IF_divider),...
1/2*(length(signal)+IF_Trend_divider)]; % x positions of labels
label_y = [0.5 0.5 0.5]; % Change this to modify the height of the label
zone_names = ["HF" "IF" "Trend"];