-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathporovnat.m
122 lines (105 loc) · 3.45 KB
/
porovnat.m
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
% POROVNAT
%
% Zadaju sa parametre prenosu regulovaneho modelu
%
% SPUSTA - TEST_POROV pre vseobecny prenos alebo
% - TEST_POROV2 pre Strejcov prenos
% - TEST_POROV3 pre Tlmene kmitavy system
% - SPAT - zatvori sa
% Generovanie nasho prenosu, ktory budeme porovnavat so zadanym
%
if(typ_i==1)
[K,M] = get_tf(1,n,K,T); % Strejcov model
DD2=D;
else
[K,M] = get_tf(2,ksi_km,K,T_km); % Kmitavy tvar
DD2=D_km;
n=2;
end
Qcit=cit;
Qmen=men;
QD=D;
Qcas_simulacie =cas_simulacie;
ic = zeros(2);
close(findobj('Tag','ptt_compare'))
close(findobj('Tag','ptt_param'))
figure('Color','blue',...
'Resize','off',...
'Tag','ptt_compare',...
'Numbertitle','off',...
'Menubar',ptv_fig_menubar,...
'name',ptg_string(1,16,ptv_str_lang), ...
'position',[150 100 280 350]);
% Clolourful effect
ptf_cfbcg(gcf,ptv_cfbcg)
%----- Info -----%
Qtext = uicontrol(gcf,...
'Style','text',...
'Fontsize',[12],...
'ForegroundColor','black',...
'BackgroundColor','green',...
'Fontweight','bold',...
'HorizontalAlignment','center',...
'Position',[20 290 240 50],...
'String',ptg_string(2,15,ptv_str_lang));
%--------------- Vyber typu prenosu ----------------------
typid = uicontrol(gcf,...
'Style','popup',...
'Position',[30 280 220 35],...
'String',ptg_string(4,6,ptv_str_lang),...
'Value',typ_id,...
'ForegroundColor','black',...
'BackGroundColor','white',...
'CallBack','typ_id = get(gco,''Value'');if(typ_id)==1,porov2,elseif(typ_id)==2,porov3,elseif(typ_id)==3,porov4,end;');
%----- Info -----%
Qtext = uicontrol(gcf,...
'Style','text',...
'Fontsize',[12],...
'ForegroundColor','black',...
'BackgroundColor','yellow',...
'Fontweight','bold',...
'HorizontalAlignment','center',...
'Position',[20 230 240 40],...
'String',ptg_string(2,16,ptv_str_lang));
%------- cas_simulacie ----------
Qcas_simulacie_text = uicontrol(gcf,...
'Style','text',...
'ForegroundColor','black',...
'BackgroundColor',[fgcolor],...
'Fontweight','bold',...
'Fontsize',[12],...
'Position',[20 55 120 25],...
'String',ptg_string(8,23,ptv_str_lang));
Hcas_simulacie = uicontrol(gcf,...
'Style','edit',...
'ForegroundColor','black',...
'Fontsize',[12],...
'BackgroundColor',[1 1 1],...
'Fontsize',[12],...
'String', num2str(Qcas_simulacie),...
'Position',[140 55 120 25],...
'CallBack',['Qcas_simulacie=str2num(get(gco,''String''));']);
%----SPAT-----%
navrat = uicontrol(gcf,...
'Style','push',...
'Position',[20 10 80 25],...
'Fontsize',[11],...
'Fontweight','bold',...
'String',ptg_string(3,2,ptv_str_lang),...
'ForegroundColor','black',...
'CallBack','close,param_vl2');
vykreslit = uicontrol(gcf,...
'Style','push',...
'Position',[145 10 115 25],...
'Fontsize',[11],...
'Fontweight','bold',...
'String',ptg_string(3,22,ptv_str_lang),...
'ForegroundColor','red',...
'CallBack','close,if(typ_id)==1,test_porov,elseif(typ_id)==2,test_porov2,elseif(typ_id)==3,test_porov3,end;');
if(typ_id)==1 % Vseobecny tvar
porov2
elseif(typ_id)==2 % Strejcov tvar
porov3
elseif(typ_id)==3 % Kmitavy tvar
porov4
end