Help needed in some qutions about normalize histogran functions(in Q3 bulding like "plot (X'Y)
2 views (last 30 days)
Show older comments
Hello, I am very much starting in Matlab and got stuck with difficulties with questions 3 and 4 (attaching my solutions to the previous sections) Can anyone prepare me for question 3?
%% Question 1:
Yi_mean=2;
Yi_STD=1;
M=10000;
Yi=normrnd(Yi_mean,Yi_STD,1,M);
figure(1)
NUM_BINS=50;
h1=histogram(Yi,NUM_BINS);
xlabel('Y');
ylabel('Frequency');
%% Question 2:
hold on;
NUM_BINS=100;
h2=histogram(Yi,NUM_BINS);
hold off;
legend('Question 1','Question 2');
title('Histograms Q1,Q2: not normalized');
0 Comments
Answers (1)
Steven Lord
on 19 Apr 2021
Read through the documentation page for the histogram function to see if it has any options and/or properties that will be of use in normalizing the histogram.
doc histogram
Spoiler alert: it does!
0 Comments
See Also
Categories
Find more on Histograms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!