a = 5
x = [ 2 1 ]
x = [ 2; 1 ]
y = [ 3; 2 ]
x * y
x .* y
w = x .* y
w = x .* y;
x ./ y
x
x .^ 2
z = x./y
z(1)
z(1)-.6666
x .'
x.'
x'
c = [ 1+5*1i ; 2-2*1i ]
c.'
c'
clear
home
ang = linspace( 0, 2*pi, 1e3 );
size( ang )
linspace(0,1,10)
linspace(0,1,11)
0:.1:1
ang = linspace( 0, 2*pi, 1e3 );
plot( ang, sin(ang) )
plot( ang, sin(ang), '.-' )
plot( ang, sin(ang), '.-r' )
plot( ang, cos(ang), '.-g' )
hold on
plot( ang, sin(ang), '.-r' )
plot( ang, sin(2*ang), '.-b' )
plot( ang, sin(ang).^2, '.-k' )
figure
plot( ang, sin(ang).^2, '.-k' )
hold on, plot( ang, .5 - .5*cos(2*ang), '.-b' )
hold on, plot( ang, .5 + .5*cos(2*ang), '.-g' )
clear
ang = linspace( 0, 20*pi, 1e3 );
figure
plot( sin(ang), cos(2*ang), '.-' )
plot( sin(ang), sin(2*ang), '.-' )
plot( sin(ang), sin(2*ang+pi/2), '.-' )
plot( sin(ang), sin(2*ang+pi/10), '.-' )
hold on
plot( sin(ang), sin(2*ang), '.-r' )
plot( sin(ang), sin(2*ang+pi/5), '.-g' )
plot( sin(ang), sin(2*ang+pi/2), '.-k' )
plot( sin(ang), sin(2*ang+pi/3), '.-m' )
figure, plot( sin(ang), sin(3*ang), '.-' )
figure, plot( sin(ang), sin(4*ang), '.-' )
figure, plot( sin(3*ang), sin(4*ang), '.-' )
figuras_LS
clear
ang = linspace( 0, 20*pi, 1e3 );
figure
plot( sin(ang), sin(2*ang+pi/10), '.-' )
hold on
plot( sin(ang), sin(2*ang), '.-r' )
plot( sin(ang), sin(2*ang+pi/5), '.-g' )
plot( sin(ang), sin(2*ang+pi/2), '.-k' )
plot( sin(ang), sin(2*ang+pi/3), '.-m' )
figure, plot( sin(ang), sin(4*ang), '.-' )
figure, plot( sin(3*ang), sin(4*ang), '.-' )
edit pi_por_mc_como_no_c
pi_exp = 4*mean( sum( rand(100,2).^2,2 )<1 )
pi_exp = 4*mean( sum( rand(1000,2).^2,2 )<1 )
pi_exp = 4*mean( sum( rand(10000,2).^2,2 )<1 )
for j=1:1000
pi_exp(j) = 4*mean( sum( rand(10000,2).^2,2 )<1 );
end
figure, plot( pi_exp, '*' )
std( pi_exp )
std( 4*mean( sum( rand(N,2,Mrep).^2, 2 )<1, 1 ) )
disp( 'Hello word' )
disp( sprintf( 'Hello word, %d', N ) )
