Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc
- clear all
- close all
- E=5
- T=10
- k1= 8/5 %E/T
- k2=-3/2 %-E/(2*T)
- pas=0.05
- f=[]
- temps=[];
- fin= 20 %5*T
- for t=-20 : pas : fin
- temps=[temps t]
- if ((t>=-16)&&(t<-8))
- f = [f 2]
- else if (t>=-8) && (t<-3)
- f = [f -3+k1*(t+8)]
- else if ((t>=-3) && (t<0))
- f = [f -3+k1*(t+8)-k1*(t+3)]
- else if ((t>=0) && (t<4))
- f = [f -3+k1*(t+8)-k1*(t+3) + k2*t]
- else if ((t>=4) && (t<16))
- f = [f -3+k1*(t+8)-k1*(t+3) + k2*t- k2 *(t-4)]
- else
- f=[f 0]
- end
- end
- end
- end
- end
- end
- figure(20)
- hold on
- plot(temps,f)
- set(gcf,'color',[1,1,1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement