% Historico de comandos aula 2
edit solucoes_exercicios_1a_aula.m
close all
whos
clear
home
dados = rand( 100, 1 );
[ xm, sx ] = estatistica( dados )
dados = rand( 10000, 1 );
[ xm, sx ] = estatistica( dados )
dados = rand( 10000, 4 );
[ xm, sx ] = estatistica( dados )
[ xm ] = estatistica( dados )
[ xm, sx ] = estatistica( dados )
disp( xm )
disp( sx )
disp(xm), disp( sx )
estatistica( dados )
plot( estatistica(dados), '*' )
edit triangulo
[ x, y ] = triangulo( 100 );
plot( x, y )
plot( x, y, '.' )
tic, [ x, y ] = triangulo( 100 ); toc
tic, [ x, y ] = triangulo( 1e4 ); toc
tic, [ x, y ] = triangulo( 1e5 ); toc
plot( x, y, '.' )
hold on
plot( x(1), y(1), 'or' )
plot( x(2), y(2), 'ok' )
plot( x, y, '.' )
plot( x(50:end), y(50:end), '.' )
[ x, y ] = triangulo( 1e5 );
plot( x, y, '.' )
plot( x, y, '.', 'markersize', 1 )
[ x, y, r ] = triangulo( 1e5 );
figure
hold on
plot( x(r==1), y(r==1), '.b', 'markersize', 1 )
plot( x(r==2), y(r==2), '.r', 'markersize', 1 )
plot( x(r==3), y(r==3), '.g', 'markersize', 1 )
ind11 = find( (r(1:end-1)==1) & (r(2:end)==1) ) + 1;
plot( x(ind11), y(ind11), '.k', 'markersize', 1 )
