clc;
close all;
clear;
workspace;
fontSize = 15;
x=rand(10,1);
y=rand(10,1);
subplot(2, 2, 1);
bar(x);
xlabel('Index of X', 'fontSize', fontSize);
ylabel('Value of X', 'fontSize', fontSize);
title('X as a function of Index', 'fontSize', fontSize);
subplot(2, 2, 2);
bar(y);
xlabel('Index of Y', 'fontSize', fontSize);
ylabel('Value of Y', 'fontSize', fontSize);
title('Y as a function of Index', 'fontSize', fontSize);
[xCounts xValues] = hist(x)
[yCounts yValues] = hist(y)
subplot(2, 2, 3);
bar(xValues, xCounts);
xlabel('Value of X', 'fontSize', fontSize);
ylabel('Frequency of Occurrence for X', 'fontSize', fontSize);
grid on;
title('Histogram of X', 'fontSize', fontSize);
subplot(2, 2, 4);
bar(yValues, yCounts);
xlabel('Value of Y', 'fontSize', fontSize);
ylabel('Frequency of Occurrence forY', 'fontSize', fontSize);
grid on;
title('Histogram of Y', 'fontSize', fontSize);
set(gcf, 'Position', get(0,'Screensize'));
Best Answer