How can I plot through a histogram the random number generated by matlab.I want to use just rand function.The output of the function is n*m matrix.
Ältere Kommentare anzeigen
function r = randomness(limit,n,m)
r=floor(1+limit*rand(n,m));
% hist(r(1:n*m),1:limit) %%r(:) is sufficient
% title('Histogram of random numbers')
end
my problem is why hist function is written in that way?
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 7 Jun. 2015
limit=10
n=4;
m=3;
r=floor(1+limit*rand(n,m))
hist(r(:))
Kategorien
Mehr zu Histograms finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!