Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dir = "C:\Users\gmone\Documents\Faculdade\Automação e controle"
- //função que corresponde a curva do sistema etapa 1(E)
- function A=ce(t)
- A=(-%e**-t)*(cos(sqrt(15)*t)+(1/sqrt(15))*sin(sqrt(15)*t)) - (2/sqrt(15)) * (%e**-t)*sin(sqrt(15)*t)+1
- endfunction
- //função que corresponde a curva do sistema etapa 2 (M)
- function A1=cm(t)
- A1=(-%e**-t)*(cos(sqrt(5)*t)+(1/sqrt(5))*sin(sqrt(5)*t)) - (2/sqrt(5)) * (%e**-t)*sin(sqrt(5)*t)+1
- endfunction
- t=0
- i=0
- clear B
- clear C
- clear T
- while t<=8
- i=i+1
- t=t+0.1
- B(i) = ce(t);
- C(i) = cm(t);
- T(i)= t;
- end
- subplot(2,2,1)
- xtitle( 'Função da questão E', 'T', 'c(t)');
- plot2d(T,B,[2]);
- subplot(2,2,2)
- xtitle( 'Função da questão M', 'T', 'c(t)');
- plot2d(T,C,[5]);
- subplot(2,1,2)
- xtitle( 'Função da questão E e M sobrepostas', 'T', 'c(t)');
- plot2d(T,B,[2]);
- plot2d(T,C,[5]);
- h1=legend(['função da E';'função da M']);
- //Exportar graficos
- xs2png(gcf(),Dir +"\Segundo Teste.png");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement