MATLAB: Stacked histogram or Stacked bar

MATLABstacked barstacked histogram

I want to plot the following:
Stacked
I am able to get the followIng:
using the code below:
load('Data.mat')
[N,edges] = histcounts(GTDF);
edges=[0 300 700 1200 2300]; %redefine the edges
[N,edges] = histcounts(GTDF,edges);
histogram(GTDF, edges, 'Normalization','probability', 'DisplayStyle','bar')
both diagrams are technically the same (percentage of counts and edges etc) but visually different. I want achieve the first diagram.
The reason i Want the first diagram is that i want to plot multiple of these Bars (as shown in first diagram) in the same window and diagram
The data is attached:

Best Answer

You can try the following
edges=[0 300 700 1200 2300 Inf]; %redefine the edges
[N,edges] = histcounts(GTDF,edges);
N = N./sum(N);
N(2,:) = NaN;
bar(N,'stacked');