FIC MATLAB - 2019/2

De MediaWiki do Campus São José
Revisão de 18h57min de 17 de setembro de 2019 por 127.0.0.1 (discussão)
Ir para navegação Ir para pesquisar

<syntaxhighlight lang=matlab class="mw-collapsible"> %-- 12-09-2019 19:04:06 --% clc a = [1 2 3 4] b = [3 4 6 2 5]; whos ab = [a b] clc whos ab2 = [a; b] b(1,end) = [] b(1,5) = [] a = [a 2] whos ab2 = [a; b] AB = [ab2 ab2] AB = [ab2 ab2; ab2 ab2] clc help repmat B = repmat(ab,2) ab B = repmat(ab,2,1) B = repmat(ab,1,2) clc whos B B clc help reshape clc reshape(B,3,6) B B = reshape(B,3,6) B = reshape(B,9,2) B = reshape(B,2,9) whos AB AB = reshape(AB, 2, 20) clc nova_matriz = [1 3; 6 2]; nova_matriz = fliplr(nova_matriz) nova_matriz = flipud(nova_matriz) vetor = ['oi, pessoas'] double(vetor) whos vetor vetor2 = double(vetor) whos vetor vetor2 char(vetor2) clc idade = input('Quantos anos tu tem?') 27 idade = input('Quantos anos tu tem?'); 27 whos idade clc idade = input('Quantos anos tu tem?'); idade = input('Quantos anos tu tem? \n'); 27 disp(['tu tem', num2str(idade)]) disp(['tu tem ', num2str(idade)]) help inputdl help inputld calculadora altura = inputdlg('qual sua altura?') calculadora 1.73 70 edit calculadora.m clc clear all clc a = [1 43 2 5 22 22 33 33 33]; b = [3 22 33 3 3 4 5 5 5 6 7]; whos matriz = [1 2 ; 5 3]; help sort sort(matriz) matriz sort(matriz,2) sort(matriz,1) clc a unique(a) union(a, b) a b clc a = [2 4 5]; b = [4 5 7]; union(a,b) intersect(a,b) setdiff(a,b) setdiff(b,a) setxor(a,b) setxor(b,a) a b clc help polyval p = [2 4 0] polyval(p) doc polyval polyval(p,[2 4]) polyval(p,4) roots(p) poly(-2,0) poly([-2 0]) poly([0 -2]) polyder(p) polyint(p) polyint(p,[-1 2]) help rand rand rand(2) rand(1,2) randn(2) help randn randn

<\code>