%% Historico aula 3
edit fractal_feto.m
edit triangulo.m
help triangulo
[ C, R ] = triangulo( 1e5 );
figure, plot( C, '.k', 'markersize', 1 )
edit mean
hist( rand(100,1), 10 )
h = hist( rand(100,1), 10 )
help nargout
home
help triangulo
[ C, R ] = triangulo( 1e5 );
plot( C, '.k' )
hold on
plot( C(R==1), '.g' )
plot( C(R==2), '.b' )
plot( C(R==3), '.r' )
triangulo( 10 )
triangulo( 10e4 )
clear
home
fractal_feto( 1e5 )
clear
home
Ps = [ .3 .5 .2 ]
cumsum( Ps )
Pac = cumsum( Ps )
r = rand
r>Pac
sum( r>Pac )
sum( r>Pac )+1
sum( r>[0 Pac] )
edit aleatorio_com_probabilidade
triangulo( 1e5 )
figure, triangulo( 1e5 )
figure, triangulo( 1e5, [.8 .1 .1] )
figure, fractal_feto( 1e5 )
figure, fractal_feto( 1e5, [.95 .02 .02 .01] )
[ X, Y, R ] =  fractal_feto( 1e5 );
figure, plot( X, Y, '.' )
figure, fractal_feto( 1e5, [.95 .02 .02 .01] )
figure, fractal_feto( 1e5, [.20 .30 .30 .20] )
figure, fractal_feto( 1e5, [.97 .01 .01 .01] )
figure, fractal_feto( 1e5 )
hold on, fractal_feto( 1e5, [.97 .01 .01 .01] )
edit aleatorio_com_probabilidade.m
figure, fractal_feto( 1e5, [10 1 5 2] )
figure, fractal_feto( 1e5, [10 0 5 2] )
figure, fractal_feto( 1e5, [10 5 0 2] )
figure, fractal_feto( 1e5, [0 5 5 2] )
close all
home
LISTA = load( 'Lista_Portugues.txt', '-ascii' )
fid = fopen( 'Lista_Portugues.txt', 'r' )
LISTA = fread( fid )
fclose( fid )
LISTA(1:10)
char( LISTA(1:10) )
char( 97 )
'a'+0
clear
home
fid = fopen( 'Lista_Portugues.txt', 'r' );
LISTA = fread( fid );
fclose( fid );
LISTA(1:12)
char( LISTA(1:12) )
char( LISTA(1:12)' )
char( LISTA(1:20)' )
LISTA( 1:20 )'
char( LISTA(1:20)' )
hist( LISTA, 1:256 )
char( 97 )
char( 122 )
ind_espacos = find( LISTA == 32 );
ind_espacos(1:4)
diff( ind_espacos(1:4) )
TAMANHOS = diff( ind_espacos )-1;
hist( TAMANHOS, 1:50 )
