1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| open_system('systeme1reg')
s1 = readfis('systeme1.fis')
%GAIN
% Initializations
% ===============
tagCollect =[] ;
timeCollect =[] ;
TCollect =[] ;
plotcolors ='bgcmkbgcmkbgcmk' ;
nvals = 0 ;
% Calculations
% ============
for gval=0.1:0.1:0.6
nvals = nvals + 1 ;
gvalStr = num2str(gval,3) ;
set_param('systeme1reg/Gain6','Gain',gvalStr) ;
sim('systeme1reg') ;
timeCollect = [timeCollect, time] ;
TCollect = [TCollect, T] ;
tag = ['Gain3 = ',gvalStr] ;
tagCollect = [tagCollect,{tag}] ;
end
% Plotting
% ========
hold off
for i=1:nvals
plot(timeCollect(:,i),TCollect(:,i),plotcolors(i));
hold on
end
hold off
legend(tagCollect) ;
xlabel('Temps') ;
ylabel('Amplitude') ; |