-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnizsien2.m
81 lines (66 loc) · 2.38 KB
/
nizsien2.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
prg% NIZSIEN2
%
% Vykreslenie simulacie Strejcovou metodou pre identifikovany prenos s
% nizsim radom
sim('compTF')
t_id=id_data3(:,1);
y_1=id_data3(:,2);
y_2=id_data3(:,3);
% Pre moznost ladenia
%
t = t_id;
yn = y_1;
% Spracovanie odchylky
%
% Vypocet chyby identifikacie: Integral(Y(povodna)-Y(identifikovana))^2 dt / Integral(Y(povodna)^2) dt
odchylka = sum( (y_1-y_2).^2 )/ sum((y_1).^2);
%
pth_fig = findobj('Tag','ptt_id_param');
if(isempty(pth_fig)~=1);
pth_fig = pth_fig(1);
% Semafor pre chybu identifikacie:
if(abs(odchylka)<0.001)
c1='green';
elseif(abs(odchylka)<0.005)
c1='yellow';
else
c1=[1 0.3 0.2];
end
odchylka_text = uicontrol(pth_fig,...
'Style','text',...
'ForegroundColor','black',...
'Fontweight','bold',...
'Fontsize',[12],...
'BackgroundColor',fgcolor,...
'Position',[20 155 250 25],...
'String',ptg_string(2,10,ptv_str_lang));
odchylka_text = uicontrol(pth_fig,...
'Style','edit',...
'ForegroundColor','black',...
'Fontweight','bold',...
'Fontsize',[12],...
'BackgroundColor',c1,...
'Position',[20 130 250 25],...
'String',num2str(odchylka) ,...
'CallBack','set(gco,''String'',num2str(odchylka))');
end
%
% Koniec - Spracovanie odchylky
% Graficky priebeh
%
figure('position',[580 60 560 420],'Color','white');
Qch1=uicontrol(gcf,'Tag','ptt_ch1',...
'Style','Check','Units','Pixels','Position',[20 7 70 20],...
'ForegroundColor','Black',...
'BackgroundColor',get(gcf,'Color'),...
'String',ptg_string(5,1,ptv_str_lang),...
'Value',Qcheck_uL,...
'Callback','ptg_plot_check(ptf_checkval(''ptt_ch1''),ptf_checkval(''ptt_ch2''),{[t_id,y_1],[t_id,y_2],{''red'',''blue''}},[19,3,4],[17,20],ptv_str_lang)');
Qch2=uicontrol(gcf,'Tag','ptt_ch2',...
'Style','Check','Units','Pixels','Position',[100 7 70 20],...
'ForegroundColor','Black',...
'BackgroundColor',get(gcf,'Color'),...
'String',ptg_string(5,2,ptv_str_lang),...
'Value',Qcheck_uG,...
'Callback','ptg_plot_check(ptf_checkval(''ptt_ch1''),ptf_checkval(''ptt_ch2''),{[t_id,y_1],[t_id,y_2],{''red'',''blue''}},[19,3,4],[17,21],ptv_str_lang)');
ptg_plot_check(ptf_checkval('ptt_ch1'),ptf_checkval('ptt_ch2'),{[t_id,y_1],[t_id,y_2],{'red','blue',}},[19,3,4],[17,21],ptv_str_lang);