Plotting random numbers in histogram and bin allocation.
조회 수: 20 (최근 30일)
이전 댓글 표시
Hi all
i have a set of 100 random numbers from 0-1, i need to plot these on a histogram and allocate them to 10 bins.
the program also needs to calculate mean and standard deviation.
i am unsure on how to do this on matlab and any help would be much appreciated.
here is the random number code i have currently.
Thanks !
clear all
clc
n = 100; % However many numbers you want.
randomNumbers = randi([0, 1], [1, n])
randomNumbers = int32(randi([0, 1], [1, n]));
댓글 수: 0
채택된 답변
KSSV
2021년 9월 5일
You have striaght away functions to achieve what you want. Read about histogram, mean, std.
댓글 수: 4
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!