Mudanças entre as edições de "FIC MATLAB 2019-2"
Ir para navegação
Ir para pesquisar
Linha 311: | Linha 311: | ||
::Calcule ''x''. Em seguida, calcule <math>\sqrt{6x}</math>. ''Resposta: Aproximadamente <math>\pi</math>.'' | ::Calcule ''x''. Em seguida, calcule <math>\sqrt{6x}</math>. ''Resposta: Aproximadamente <math>\pi</math>.'' | ||
+ | |||
+ | |||
+ | {{collapse bottom}} | ||
+ | |||
+ | === Plots === | ||
+ | |||
+ | {{collapse top| bg=lightblue |Aula 4 - 26 de março}} | ||
+ | |||
+ | * Plots: | ||
+ | :* Comandos ''plot'', ''stem'', ''bar'' e ''stairs'' de uma função | ||
+ | ::* Uso de apenas um parâmetro | ||
+ | :* Comando ''hold'' para manter a curva no gráfico | ||
+ | :* Comando ''grid'' para mostrar linhas em forma de grade | ||
+ | :* Nomes aos eixos com ''xlabel'' e ''ylabel'' | ||
+ | :* Comando ''title'' | ||
+ | :* Comandos ''axis'', ''xlim'' e ''ylim'' para ajuste de eixos | ||
+ | :* Comando ''legend'' | ||
+ | |||
+ | :* Especificadores de linha, cores e marcadores: | ||
+ | |||
+ | :::{| class="wikitable" | ||
+ | ! '''Tipo de linha''' | ||
+ | ! '''Símbolo''' | ||
+ | |- | ||
+ | | Sólida (padrão) || - | ||
+ | |- | ||
+ | | Tracejada || -- | ||
+ | |- | ||
+ | | Tracejada com pontos || -. | ||
+ | |- | ||
+ | | Com pontos || : | ||
+ | |} | ||
+ | |||
+ | :::{| class="wikitable" | ||
+ | ! '''Cores''' | ||
+ | ! '''Símbolo''' | ||
+ | |- | ||
+ | | Preto || k | ||
+ | |- | ||
+ | | Azul || b | ||
+ | |- | ||
+ | | Ciano || c | ||
+ | |- | ||
+ | | Verde || g | ||
+ | |- | ||
+ | | Magenta || m | ||
+ | |- | ||
+ | | Vermelho || r | ||
+ | |- | ||
+ | | Branco || w | ||
+ | |- | ||
+ | | Amarelo || y | ||
+ | |} | ||
+ | |||
+ | :::{| class="wikitable" | ||
+ | ! '''Marcadores de dados''' | ||
+ | ! '''Símbolo''' | ||
+ | |- | ||
+ | | Ponto || . | ||
+ | |- | ||
+ | | Asterisco || * | ||
+ | |- | ||
+ | | Cruz || x | ||
+ | |- | ||
+ | | Círculo || o | ||
+ | |- | ||
+ | | Adição || + | ||
+ | |- | ||
+ | | Quadrado || s | ||
+ | |- | ||
+ | | Losango || d | ||
+ | |- | ||
+ | | Triângulo apontando pra cima || ^ | ||
+ | |- | ||
+ | | Triângulo apontando pra baixo || v | ||
+ | |- | ||
+ | | Triângulo apontando pra direita || > | ||
+ | |- | ||
+ | | Triângulo apontando pra esquerda || < | ||
+ | |- | ||
+ | | Estrela de 5 pontas || p | ||
+ | |- | ||
+ | | Estrela de 6 pontas || h | ||
+ | |} | ||
+ | |||
+ | |||
+ | * Outros comandos relacionados a plotagem: | ||
+ | :* Comando ''figure'' | ||
+ | :* Comando ''subplot'' | ||
+ | :* Comando ''close all'' para fechar todas figuras | ||
+ | |||
+ | * '''Exercícios''' | ||
+ | |||
+ | :1. Plote, em um mesmo gráfico, as funções | ||
+ | :::::<math>f(x) = \sqrt{1 - (|x| - 1)^2}</math> | ||
+ | ::e | ||
+ | :::::<math>\displaystyle{g(x) = \arccos(1 - |x|) - \pi},</math> | ||
+ | ::para <math>-2 \leq x \leq 2</math>. | ||
+ | |||
+ | :2. Plote a função <math>\displaystyle{f(x) = x^2 + x - 2}</math> de -4 até 4. Para certificar que o plot está correto, calcule na mão as raízes da função, e compare com os pontos onde a curva cruza o eixo horizontal (onde <math>\displaystyle{f(x) = 0}</math>) | ||
+ | |||
+ | :3. Utilize o MATLAB para plotar a função <math>\displaystyle{T = 3 \ln (2 t) - 5 e^{0,5 t}}</math> ao longo do intervalo <math>1 \leq t \leq 3</math>. Insira um título na plotagem e rotule adequadamente os eixos. A variável ''T'' representa a temperatura em graus Celsius; a variável ''t'' representa o tempo em minutos. | ||
+ | |||
+ | :4. Plote as funções <math>\displaystyle{u = 100 \log_{10} (60 x + 1)}</math> e <math>\displaystyle{v = 50 \cos(6 x) \mathrm{sen} (2 x) + 150 x}</math> ao longo do intervalo <math>0 \leq x \leq 2</math>. Rotule adequadamente a plotagem e cada uma das curvas, utilizando '''legend'''. A variável ''u'' representa a velocidade de uma Ferrari em km/h. A variável ''v'' representa a velocidade de um Fusca. | ||
+ | |||
+ | :5. Use a função ''stem'' para plotar os sinais abaixo na mesma figura: | ||
+ | :: <math>\displaystyle{\cos(x)}</math>, para <math>0 \leq x \leq 2 \pi</math> | ||
+ | :: <math>\displaystyle{0,5 \sin(x)}</math>, para <math>\pi \leq x \leq 3 \pi</math> | ||
+ | |||
+ | :6. A série de Fourier é uma representação em série de funções periódicas em termos de senos e cossenos. A representação em série de Fourier da função | ||
+ | :::::<math>f(x) = | ||
+ | \begin{cases} | ||
+ | -1, & -\pi \leq x \leq 0 \\ | ||
+ | 1, & 0 \leq x \leq \pi | ||
+ | \end{cases}</math> | ||
+ | ::é | ||
+ | :::::<math>g(x) = \frac{4}{\pi} \left( \frac{\sin(x)}{1} + \frac{\sin(3x)}{3} + \frac{\sin(5x)}{5} + \frac{\sin(7x)}{7} + \cdots \right)</math>. | ||
+ | ::Plote, em um mesmo gráfico, a função ''f''(''x'') e sua representação em série ''g''(''x''), utilizando os quatro termos explicitados. Considere ''x'' na faixa de <math>-\pi</math> até <math>\pi</math>. | ||
+ | |||
+ | :7. Fazer o ''plot'' de um sinal de tensão versus tempo, como da figura: | ||
+ | :::::<math>f(t) = | ||
+ | \begin{cases} | ||
+ | \sin(2 \pi t / 63), & \text{de } t = 1s \text{ ate } t = 63s \\ | ||
+ | 0, & \text{de } t = 64s \text{ ate } t = 80s \\ | ||
+ | 1, & \text{de } t = 81s \text{ ate } t = 100s \\ | ||
+ | -1, & \text{de } t = 101s \text{ ate } t = 120s | ||
+ | \end{cases}</math> | ||
+ | :: Não esquecer de nomear os eixos. | ||
+ | [[Image:Exercícios Aula 3 FIC Matlab.jpg|600px|center]] | ||
+ | |||
+ | :8. '''Desafio''': Resolva a questão 6, apresentando a resposta para um número genérico "N" de termos. | ||
+ | |||
+ | |||
+ | {{collapse bottom}} |
Edição das 17h40min de 5 de setembro de 2019
Informações Básicas
- Código: MLB16470
- Professores: Ana Paula Rosa Negri
- Início: 27/08/2019
- Término: 31/10/2019
- Horário: Terças e quintas, das 19h às 22h
- Referência Básica: PALM, William J. Introdução ao MATLAB para engenheiros. Tradução de Tales Argolo Jesus. 3. ed. Porto Alegre: AMGH, 2013. xiv, 562, il. ISBN 9788580552041
- Referência Complementar: MORAIS, V.. VIEIRA, C. MATLAB Curso Completo. FCA, 2013. 644. ISBN 9727227058
Conteúdos Abordados
Apresentação da disciplina; Interface do MATLAB; Operadores; Funções; Constantes especiais; Formatos de exibição
Aula 1 - 27 de agosto | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Observações:
|
Vetores e matrizes
Aula 2 - 29 de agosto |
---|
|
Operações com matrizes
Aula 3 - 03 de setembro |
---|
|
Plots
Aula 4 - 26 de março | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|