FIC matlab 2019 2

De MediaWiki do Campus São José
Ir para: navegação, pesquisa
%-- 10-09-2019 19:05:22 --%
format compact
x = -2:2;
x = -2:0.1:2;
fx = sqrt(1-(abs(x)-1).^2);
gx = acos(1 - abs(x)) - pi;
figure
plot(x,fx,'r','Linewidth',2)
hold on
plot(x,gx,'r','Linewidth',2)
clc
%7
t1 = 1:63;
t2 = 64:80;
t3 = 81:100;
t4 = 101:120;
f1 = sin(2*pi.*t/63);
f1 = sin(2*pi.*t1/63);
f2 = zeros(size(64:80));
f3 = ones(size(t3));
f4 = -1*ones(size(t4));
figure
plot(t1,f1)
hold on
plot(t2,f2)
plot(t3,f3)
plot(t4,f4)
plot([80 81], [0 1])
plot([100 101], [1 -1])
clc
%aula de hoje
v = randi(1,3)
v = randi(3)
help randi
v = randi(10,3)
v = randi(10,3,1)
help randn
b = randn(1,3)
clc
A = randi(10,4)
v = randi(10,1,4)
v1 = v(3)
v2 = v(2)
v2 = v(4)
A
A1 = A(5)
A1 = A(9)
A1 = A(1,3)
A1 = A(1,2)
A
A(3,2)
A(3,5)
v
v(3)
clc
x= 4;
n = 2;
matriz = randn(n,x)
matriz(n,x)
x= 3;
n = 4;
matriz = randn(n,x)
matriz(n,x)
x= 1;
matriz(n,end)
matriz(end,end)
A
clc
A
a = A([1 3],:)
a = A(1:3,:)
a = A(1:3,1:3)
A
a = A(2:end,2:end)
A(1:2,2)
A
A(1,:) = []
A
A(:,4)
A(:,4) = []
A