Baixe o app para aproveitar ainda mais
Prévia do material em texto
Segunda e terceira Aulas 2006-30/08e 6/10/2006 Aulas de Exercício de Cálculo Numérico 2006 em grupo sem intervalos e presença obrigatória Revisão MATLAB- BCC 20006- J M Balthazar • Parte A 1. Use o comando 1:1.0:1−=x e, execute e os discute as expressões(com o máximo de cautela) )4.^cos(,(;2.^);cos(;3.^);sin();( xxplotxxxxxsqrt 2. Execute o comando dado a seguir e explique os resultados 2:1:1 ]2345[ −= = y x yxyxyx /.;*.;.^ 3. Escreva ]905;101;531[=A com a vírgula no final e não 4. Seja a matriz ]713412;78184;851[=A e examine os comandos )3:2(:,:);,3();1(:,:);,2:1();3,3();2,1();1,2();1,1( AAAAAAAA • Parte B 1. Resolva os exemplos dos arquivos: R�������� �� ����� ��� ������ �������������������������� � • Parte C 2. Resolva a serie de exercícios do site do Prof. Balthazar, denominada de lista exercícios série 1-aulas calculo numérico • Parte D Escrita no MATLAB Sabe-se que em MATLAB ressioniable expvar = e para se programar se deve fazer uso de 1. for loop sintaxe end Statements ressionloopiableloopfor expvar = 2. while sintaxe end Statements ressionwhilewhile exp_ 3. if sintaxe end Statements else Statements resionifelseif Statements ressionifif −−−−−−−−−−−−−− exp_ exp_ 4. Programas em MATLAB Achar as raízes de )4.2cos()4.2 2()( 34.2 xx x pi +− Em matlab: )*cos(*23^ 4.2 )(1 xpixxp x x xfuncfunctionp +−= = = )9.2,1( ′′= funcfzerosolution Neste caso teremos a melhor solução próximo de 2.9 5. INPUT , OUTPUT • Disp: allows the display of text and values on the screen. To output the contents of the matrix A on the screen . Sintaxe: )(Adisp );'(' textthisdisplayswillthisdisp • We can consider the input of text and data from the keyboard. An interactive way of obtaining input is to use the function input )(var ttexinputiable ′′= 6. SPEEDING UP CALCULATIONS )]);(2,[( ; )( 1000:1:1 ; ; tstrnumsimethodvectorfortakentimedosp toct asqrtb a tic clear ′′ = = = 7. Newton’s Method – fazer os programas em MATLAB resolver a- 0202910 23 =−+− xxx ?=x b- 1 422 = =+ xy yx ?, =yx
Compartilhar