edit gera_inteiro.m
gera_inteiro( [.5 .4 .1], 10 )
[I] = gera_inteiro( [.5 .4 .1], 1e4 );
figure, hist( I, 1:3 )
[I] = gera_inteiro( [10 2 8], 1e4 );
figure, hist( I, 1:3 )
edit gera_triangulo
help gera_triangulo
help while
help do
[ X, Y ] = gera_triangulo( 1e4 );
[ X, Y ] = gera_triangulo( 1e5 );
[ X, Y ] = gera_triangulo( 1e2 );
whos
[ X, Y ] = gera_triangulo( 1e5 );
figure, plot( X, Y, '.' )
[ X, Y ] = gera_triangulo( 1e5 );
figure, plot( X, Y, '.' )
[ X, Y ] = gera_triangulo( 1e5 );
figure, plot( X, Y, '.' )
[ X, Y ] = gera_triangulo( 1e5 );
figure, plot( X, Y, '.' )
X(1)
Y(1)
figure, plot( X(101:end), Y(101:end), '.' )
close all
figure, plot( X(101:end), Y(101:end), '.', 'markersize', 1 )
[ X, Y ] = gera_triangulo( 1e5 );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y ] = gera_triangulo( 1e6 );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y ] = gera_triangulo( 1e6, [3 1 1] );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y ] = gera_triangulo( 1e5, [1 3 1] );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y ] = gera_triangulo( 1e5, [1 1 3] );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y ] = gera_triangulo( 1e5, [1 1 0] );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y ] = gera_triangulo( 1e5, [1 1 0.1] );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y ] = gera_triangulo( 1e5, [1 0.1 0.1] );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y, r ] = gera_triangulo( 1e5, [1 1 1] );
X(1:10) Y(1:10) r(1:10)
X(1:10), Y(1:10), r(1:10)
[ X(1:10), Y(1:10), r(1:10) ]
i1 = find( r(1:10)==1 )
i1 = find( r==1 );
figure
hold on
plot( X(i1), Y(i1), '.r' )
i2 = find( r==2 );
plot( X(i2), Y(i2), '.g' )
plot( X(r==3), Y(r==3), '.y' )
help axis
i12 = find( r(1:end-1)==1 & r(2:end)==2 ) + 1;
plot( X(i12), Y(i12), '.k' )
[ X, Y, r ] = gera_samambaia( 1e5 );
figure, plot( X, Y, '.' )
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y, r ] = gera_samambaia( 1e5 );
figure, plot( X, Y, '.', 'markersize', 1 )
[ X, Y, r ] = gera_samambaia( 1e5 );
figure, plot( X, Y, '.', 'markersize', 1 )
figure, plot( X, Y, '.r', 'markersize', 1 )
[ X, Y, r ] = gera_samambaia( 1e6 );
figure, plot( X, Y, '.r', 'markersize', 1 )
[ X, Y, r ] = gera_samambaia( 1e6 );
figure, plot( X, Y, '.r', 'markersize', 1 )
[ X, Y, r ] = gera_samambaia( 1e6 );
figure, plot( X, Y, '.b', 'markersize', 1 )
clear
home
close all
[ X, Y, r ] = gera_samambaia( 1e6 );
tic, [ X, Y, r ] = gera_samambaia( 1e6 ); toc
figure
hold on
plot( X(r==1), Y(r==1), '.y' )
plot( X(r==2), Y(r==2), '.b' )
plot( X(r==3), Y(r==3), '.g' )
plot( X(r==4), Y(r==4), '.r' )
figure, plot( X, Y, '.b' )
tic, [ X, Y, r ] = gera_samambaia( 1e6 ); toc
figure, hold on
plot( X, Y, '.g', 'markersize', 1 )
tic, [ X, Y, r ] = gera_samambaia( 1e5, [1 7 7 300] ); toc
plot( X, Y, '.k', 'markersize', 1 )
tic, [ X, Y, r ] = gera_samambaia( 1e5, [50 7 7 85] ); toc
plot( X, Y, '.r', 'markersize', 1 )
