You are on page 1of 4

Ejercicio 1 de taller 3 de probabilidad y estadis-

tica
clear all
close all
clc

lastName = {'[3,5]','(5,7]','(7,9]','(9,11]'};

x = [4 8 4 6 8 6 7 7 7 8 10 9 7 6 10 8 5 9 6 3 7 6 4 7 6 9 7 4 7 6 8 8
9 11 8 7 10 8 5 7 7 6 5 10 8 9 7 5 6 6 8 8 9 11 8 7 10 8];

a = min(x) %% Valor minimo

b = max(x) %% Valor maximo

m=[4 6 8 10];

f = hist(x,m);
fr = f/58;
F = cumsum(f);
Fr = F/58;
m=m'
f=f(1:4)'
fr=fr(1:4)'
F=F(1:4)'
Fr=Fr(1:4)'
T = table(m,f,fr,F,Fr,'RowNames',lastName) %% Tabla de frecuencia
figure(1)
subplot(3,1,1)
hist(x,m)
grid on
title ('Histograma')

subplot(3,1,2)
mp = [2 m' 12];
fp = [0 f' 0];
plot (mp,fp,'o')
hold on
plot (mp,fp)
grid on
title('Poligono de frecuencia')

subplot(3,1,3)
c = [1:5];
Fo = [0 F'];
plot(c,Fo,'o')
hold on
plot(c,Fo)
grid on
title ('Ojiva')

1
Xb = mean (x) % Media aritmetica o media de la muestra
m1 = median (x) % Mediana de la muestra
xmoda = mode(x) % Moda
S2 = var(x) % Varianza muestral
S3 = std(x) % Desviación estandar muestral

a =

b =

11

m =

4
6
8
10

f =

9
23
19
7

fr =

0.1552
0.3966
0.3276
0.1207

F =

9
32
51
58

Fr =

0.1552
0.5517

2
0.8793
1.0000

T =

4×5 table

m f fr F Fr
__ __ _______ __ _______

[3,5] 4 9 0.15517 9 0.15517


(5,7] 6 23 0.39655 32 0.55172
(7,9] 8 19 0.32759 51 0.87931
(9,11] 10 7 0.12069 58 1

Xb =

7.2414

m1 =

xmoda =

S2 =

3.3091

S3 =

1.8191

3
Published with MATLAB® R2018a

You might also like