%% Historico de comandos da 1a aula
a = 10
mkdir curso
cd curso
cd
cd ..
a = [ 1 2 3 ]
a(3)
a = [ 10 20 30; 11 21 31 ]
a(3)
a( : )
a
a(2,3)
find( a>20 )
a( [4 5 6] )
a( a>20 )
a(1:end)
a(1:3)
1:3
1:2:6
1:.2:6
ans( 5 )
ans( 7 )
edit teste
help rand
clear
a = randn( 1e6, 1 );
a(a>4)
clear
a = randn( 1e5, 1 );
plot( a, '.' )
plot( a, '.r' )
hold on
plot( 1:1e5, -3, '.b' )
clear
a=randn( 1e5, 1 );
a_menor3 = a( abs(a)<=3 );
a_maior3 = a( abs(a)>3 );
plot( a_menor3, '.b' )
hold on
plot( a_maior3, '.r' )
plot( a, 'xb' )
plot( a, 'xk' )
clear
a=randn( 1e5, 1 );
ind = (1:length(a));
a_menor3 = a( abs(a)<=3 );
ind_menor3 = ind( abs(a)<=3 );
a_maior3 = a( abs(a)>3 );
ind_maior3 = ind( abs(a)>3 );
figure
plot( ind_menor3, a_menor3, '.b' )
hold on
plot( ind_maior3, a_maior3, '.r' )
mean( a )
sdt( a )
std( a )
a = randn(1e5,1);
mean( a )
clear
home
a = (1:10)
a = (1:10)'
a * a
a .* a
a .^2
a .^ 2
a * a'
a' * a
edit geraPIexp
clear
N = 10;
sum( rand(N,2).^2 )<1
clear
sum( rand(2,1).^2 )<1
clear
sum( rand(2,1).^2 )<1
clear
sum( rand(2,1).^2 )<1
clear
sum( rand(2,1).^2 )<1
clear
sum( rand(2,1).^2 )<1
clear
sum( rand(2,1).^2 )<1
clear
N=10;
sum( rand(2,N).^2 )<1
clear
N=10;
4*mean( sum( rand(2,N).^2 )<1 )
help mean
format long
clear
N=1e4;
4*mean( sum( rand(2,N).^2 )<1 )
plot( PIs, '.' )
std( PIs )
clear
PIexp = 4*mean( sum( rand(2,N,100).^2 )<1 )
clear
N=1e4;
PIexp = 4*mean( sum( rand(2,N,100).^2 )<1 )
std( PIexp )
