Files
matlab/common/l10.m
T
jens b31f3e7435 - added
git-svn-id: http://moon:8086/svn/matlab/trunk@153 801c6759-fa7c-4059-a304-17956f83a07c
2021-03-22 20:28:22 +00:00

33 lines
1.0 KiB
Matlab
Executable File

% ##################################################################################
% ## Loesung: Gleichverteilter zeitdiskreter stochastischer Prozess ##
% ##################################################################################
N=10000;
% ##### Teilaufgabe a: Rauschfolge #####
n = rand(N,1);
% ##### Teilaufgabe b: Histogramm #####
n = rand(N,1);
[H,x] = hist(n,30);
H = H/N; % Damit H eine Schaetzung der Wahrscheinlichkeitsdichte
% ist, muss die Flaeche eins sein
figure; bar(x,H);grid; xlabel('x'); ylabel('f_X(x)');
title(['Gleichvert. Mittelw.=',num2str(mean(n)),' Var.=',num2str(std(n).^2)]);
% ##### Teilaufgabe c: Mittelwert und Varianz #####
n = rand(N,1);
m = mean(n);
s = std(n);
% ##### Teilaufgabe d: Musterfunktion #####
for k=1:5
n = rand(N,1);
[H,x]=hist(n,30);
H = H/N;
figure; bar(x,H); grid; xlabel('x'); ylabel('f_X(x)');
title(['Gleichvert. Mittelw.=',num2str(mean(n)),' Var.=',num2str(std(n).^2)]);
end;
% ##### EOF #####