5+5
3+1
6-3
A =7
whos
A=6
A=[3 1;8 9]
whos
clear
clc
A(1,1)=3
whos
A(2,1)=8
A(2,2)=9
A(1,2)=1
clc
A(1,1)
A(2,2)
A
B=[4 2; 7 5]
A*B
A
B
A-B
A.*B
A
B
A.*B
A
A'
A.'
i
C=5+4*i
D=2+3*i
C+D
C=[1 +i,5-4*i;8+4*i,3]
C=[1+i,5-4*i;8+4*i,3]
C=[1+i 5-4*i;8+4*i,3]
C'
C.'
clc
x=[1 2 3 4 5 6 7 8 9]
clc
x=1:1:50
x=1:2:50
x=10:-2:0
whos
x(1:3)
x
clc
x=0:0.01:2*pi
whos
y=sin(x)
plot(x,y)
plot(x,y,'.')
clc
clear
clc
clear
A=[1 1;1 -1]
B=[3;1]
x=inv(A)*B
dir
clc
teste
TESTE
dir
DIR
TESTE
dir
DIR
what
edit exemplos_pi_por_monte_carlo_script.m
help rand
help plot
clear
home
sqrt( 3/ N )
M = 500;
for j=1:M
pi_mc(j) = 4 * mean( sum( rand(N,2).^2, 2 )<=1 );
end
whos
figure, plot( pi_mc, '*' )
std( pi_mc )
pi2 = 4 * mean( sum( rand(N,2,500).^2, 2 )<=1 );
std( pi2 )
