MATLAB Answers

How to find bin mesh,edges and centres

2 views (last 30 days)
Lakshit Chugh
Lakshit Chugh on 4 May 2020
Edited: darova on 4 May 2020
i have given bin width and i am confused how should i find bin mesh bin edges and bin centres i have this code but its not working..
% Get the bin mesh. Put some extra space on the ends.
x_lim_left = 0;
x_lim_rght = +4;
%x_lim_left = -1;
%x_lim_rght = +12;
t0 = x_lim_left;
tm = x_lim_rght;
rng = tm-t0;
nbin = ceil(rng/h);
bins = t0:h:(nbin*h+t0); % <- the bin edges ...
bc = bins(1:end-1)+0.5*h; % <- the bin centers ...
  3 Comments

Sign in to comment.

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!