Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

%%%%%%%%%%%%%%%%%%

% Ejemplo 1-Diagrama de Barras


%%%%%%%%%%%%%%%%%
clc, clear
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];
bar(y);
x = 1900:10:2000;
y = [75 91 105 123.5 131 150 179 203 226 249 281.5];
bar(x,y);
A = [2 2 3; 2 5 6; 2 8 9; 2 11 12];
bar(A);
A = [2 2 3; 2 5 6; 2 8 9; 2 11 12];
bar(A,'stacked')
x = [1980 1990 2000];
y = [15 20 -5; 10 -17 21; -10 5 15];
bar(x,y,'stacked')
X = categorical({'Small','Medium','Large','Extra Large'});
X = reordercats(X,{'Small','Medium','Large','Extra Large'});
Y = [10 21 33 52];
bar(X,Y);
%%%%%%%%%%%%%%%%%
% Ejemplo 2-Tablas de Frecuencias
%%%%%%%%%%%%%%%%%
clc, clear
A = importdata('data1.txt');
x = categorical({'Dia 1','Dia 2','Dia 3','Dia 4','Dia 5','Dia 6','Dia
7'});
X = reordercats(x,{'Dia 1','Dia 2','Dia 3','Dia 4','Dia 5','Dia
6','Dia 7'});
y = A';
bar(x,y,'stacked');
y = reshape(A,[],1);
tabulate(y)
histogram(data1,7);
%%%%%%%%%%%%%%%%%%
% Ejemplo 3-Tablas de Frecuencias
%%%%%%%%%%%%%%%%%
clc, clear
load patients
newDiastolic = categorical(Diastolic);
tabulate(newDiastolic)
newAge = categorical(Age);
tabulate(newAge)
tabulate(Location)

You might also like