Códigos Aula 2

De MediaWiki do Campus São José
Ir para: navegação, pesquisa
%-- 29-08-2019 18:37:55 --%
c = 3;
delta = b^2 - (4 * a * c)
clc
c = 1
d = a + b
c = 1;
help sqrt
doc sqrt
lookfor sqrt
3.56
format short
3.56
format ong
format long
3.56
format short e
3.56
356834298
356834298.324
format long e
356834298.324
format bank
356834298.324
3.5382
format rat
3.5382
format +
3.73
-3.73
0
format short
format compact
8923
format loose
8923
vetor = [1 2 3 4 5]
vetor = [2 4 6 3 0]
vetor = [2 4 6]
length(vetor)
vetor = [1 2 3 4 5]
length(vetor)
vetor = [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
vetor = 1:20
vetor = 1:1:20
vetor = 1:2:20
vetor = 1:0.5:20
vetor = 1:-2:20
vetor = 20:-2:1
matriz = [1 2; 3 4; 5 6]
matriz = [1:4; 5:8]
matriz = [1,2; 3,4; 5,6]
length(matriz)
size(matriz)
help linspace
vetor = linspace(1,20)
vetor = linspace(1,20,21)
vetor = linspace(1,20,20)
vetor = linspace(1,20,35)
matriz = [linspace(1,5,3); 1,2,3]
matriz = [linspace(1,5,3); 1:3]
help logspace
logspace(0,4)
logspace(-4,0)
logspace(0,4,10)
matriz = [logspace(1,5,3); 1:3]
help eye
eye
eye(5)
doc eye
eye(5,6)
eye(6,5)
help zeros
x = zeros
zeros(4)
zeros(3,4)
zeros(1,4)
help ones
ones
ones(5)
ones(2,5)
help logspace
doc logspace
logspace(1,3,50)
log10(0.01)
log10(logspace(1,3,50))
x = 0 1 2 3 4 5
x = [0 1 2 3 4 5]
clc
x
x'
transpose(x)
x = [0.5+2i 3-0.4i]
x'
transpose(x)
x.'
vetor1a = linspace(5,28)
vetor1a = [5:0.2323:28]
vetor1b = [5:0.2:14]
vetor1b = linspace(5,14,46)
vetor1c = linspace(-2,5,50)
5-4.8572
vetor1c = [-2:0.1429:5]
vetor1d = linspace(100,12)
100-99.1111
vetor1d = [100:-0.8889:12]
vetor2a = logspace(1,3)
vetor2b = logspace(-2, 1, 20)
vetor2b = logspace(-2, 0, 20)
x = linspace(0,10,6)
A = [3*x;5*x-20]
x = x'
A = [3*x, 5*x-20]
A'
logspace(log10(2), log10(1024), 10)
round(logspace(log10(2), log10(1024), 10))