MATLAB: How to predetermine the load bins in a histogram

binshistogram

Dear all, I draw a histogram for an array called (single{K}), using the following code, it seems ok but what I need to do is how to determine the ranges of load bins before drawing it? i already defined the number of bins which is 38, but how can i tell matlab to set the bins with fixed increments, such as: 3000 to 40000 lb at 1000 lb interval? attached is my histogram which needs help
figure
histogram(single{K}, 38)
xlabel('Load in Kips')
ylabel('Counts')
title(['ALS for C9 Single For Month ',num2str(months),' ', 'Station' ,' ', num2str(stations)])

Best Answer

Use bin edges:
edges = [-inf, 3000:1000:40000, inf];
histogram(single{K}, edges);