function varargout = routhgui(varargin)

gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
    'gui_Singleton',  gui_Singleton, ...
    'gui_OpeningFcn', @routhgui_OpeningFcn, ...
    'gui_OutputFcn',  @routhgui_OutputFcn, ...
    'gui_LayoutFcn',  [] , ...
    'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end


function routhgui_OpeningFcn(hObject, eventdata, handles, varargin)

handles.output = hObject;

guidata(hObject, handles);


function varargout = routhgui_OutputFcn(hObject, eventdata, handles)

varargout{1} = handles.output;


function edit1_Callback(hObject, eventdata, handles)


function edit1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit2_Callback(hObject, eventdata, handles)


function edit2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit3_Callback(hObject, eventdata, handles)


function edit3_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function pol2_Callback(hObject, eventdata, handles)


function pol1_Callback(hObject, eventdata, handles)


function pushbutton1_Callback(hObject, eventdata, handles)

% Naplneni promenych obsahem bunek
s2 = get(handles.edit1,'String');
s0 = get(handles.edit3,'String');

% Definice prohledavanych oblasti
zaklad2 = sprintf('%s', s2);
zaklad0 = sprintf('%s', s0);

% Specifikovani hledanych znaku
hledam = '([A]\d)';
nalezene2 = unique(regexpi(zaklad2, hledam, 'match'));
nalezene0 = unique(regexpi(zaklad0, hledam, 'match'));

% Osetreni pri zmene obsahu vychozich bunek
pa1 = 0;
pa2 = 0;
pa1x = 0;
pa2x = 0;
set(handles.s2_text_a1,'Visible','Off');
set(handles.s2_edit_a1,'String','','Visible','Off');
set(handles.s2_text_a2,'Visible','Off');
set(handles.s2_edit_a2,'String','','Visible','Off');
set(handles.s2_text_a3,'Visible','Off');
set(handles.s2_edit_a3,'String','','Visible','Off');
set(handles.s2_text_a4,'Visible','Off');
set(handles.s2_edit_a4,'String','','Visible','Off');
set(handles.s2_text_a5,'Visible','Off');
set(handles.s2_edit_a5,'String','','Visible','Off');
set(handles.s2_text_a6,'Visible','Off');
set(handles.s2_edit_a6,'String','','Visible','Off');
set(handles.s2_text_a7,'Visible','Off');
set(handles.s2_edit_a7,'String','','Visible','Off');
set(handles.s2_text_a8,'Visible','Off');
set(handles.s2_edit_a8,'String','','Visible','Off');
set(handles.s2_text_a9,'Visible','Off');
set(handles.s2_edit_a9,'String','','Visible','Off');
set(handles.s2_text_a10,'Visible','Off');
set(handles.s2_edit_a10,'String','','Visible','Off');
set(handles.s0_text_a1,'Visible','Off');
set(handles.s0_edit_a1,'String','','Visible','Off');
set(handles.s0_text_a2,'Visible','Off');
set(handles.s0_edit_a2,'String','','Visible','Off');
set(handles.s0_text_a3,'Visible','Off');
set(handles.s0_edit_a3,'String','','Visible','Off');
set(handles.s0_text_a4,'Visible','Off');
set(handles.s0_edit_a4,'String','','Visible','Off');
set(handles.s0_text_a5,'Visible','Off');
set(handles.s0_edit_a5,'String','','Visible','Off');
set(handles.s0_text_a6,'Visible','Off');
set(handles.s0_edit_a6,'String','','Visible','Off');
set(handles.s0_text_a7,'Visible','Off');
set(handles.s0_edit_a7,'String','','Visible','Off');
set(handles.s0_text_a8,'Visible','Off');
set(handles.s0_edit_a8,'String','','Visible','Off');
set(handles.s0_text_a9,'Visible','Off');
set(handles.s0_edit_a9,'String','','Visible','Off');
set(handles.s0_text_a10,'Visible','Off');
set(handles.s0_edit_a10,'String','','Visible','Off');

% Je-li pouzit jednopolovy model pro vypocet (s2)
if (get(handles.pol1,'Value') == get(handles.pol1,'Max'))
    
    % Zobrazeni tolika objektu, kolik bylo nalezeno Alfa (s2)
    pa1x = length(nalezene2);
    for pa1 = 1:pa1x
        if(pa1 == 1)
            set(handles.s2_text_a1,'String',nalezene2{pa1},'Visible','On');
            set(handles.s2_edit_a1,'Visible','On');
        else
            if(pa1 == 2)
                set(handles.s2_text_a2,'String',nalezene2{pa1},'Visible','On');
                set(handles.s2_edit_a2,'Visible','On');
            else
                if(pa1 == 3)
                    set(handles.s2_text_a3,'String',nalezene2{pa1},'Visible','On');
                    set(handles.s2_edit_a3,'Visible','On');
                else
                    if(pa1 == 4)
                        set(handles.s2_text_a4,'String',nalezene2{pa1},'Visible','On');
                        set(handles.s2_edit_a4,'Visible','On');
                    else
                        if(pa1 == 5)
                            set(handles.s2_text_a5,'String',nalezene2{pa1},'Visible','On');
                            set(handles.s2_edit_a5,'Visible','On');
                        else
                            if(pa1 == 6)
                                set(handles.s2_text_a6,'String',nalezene2{pa1},'Visible','On');
                                set(handles.s2_edit_a6,'Visible','On');
                            else
                                if(pa1 == 7)
                                    set(handles.s2_text_a7,'String',nalezene2{pa1},'Visible','On');
                                    set(handles.s2_edit_a7,'Visible','On');
                                else
                                    if(pa1 == 8)
                                        set(handles.s2_text_a8,'String',nalezene2{pa1},'Visible','On');
                                        set(handles.s2_edit_a8,'Visible','On');
                                    else
                                        if(pa1 == 9)
                                            set(handles.s2_text_a9,'String',nalezene2{pa1},'Visible','On');
                                            set(handles.s2_edit_a9,'Visible','On');
                                        else
                                            if(pa1 == 10)
                                                set(handles.s2_text_a10,'String',nalezene2{pa1},'Visible','On');
                                                set(handles.s2_edit_a10,'Visible','On');
                                            else
                                                msgbox('Bylo zadáno více než 10 parametrů Alfa.','Chyba!');
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
    pa2x = length(nalezene0);
    for pa2 = 1:pa2x                       % (s0)
        if(pa2 == 1)
            set(handles.s0_text_a1,'String',nalezene0{pa2},'Visible','On');
            set(handles.s0_edit_a1,'Visible','On');
        else
            if(pa2 == 2)
                set(handles.s0_text_a2,'String',nalezene0{pa2},'Visible','On');
                set(handles.s0_edit_a2,'Visible','On');
            else
                if(pa2 == 3)
                    set(handles.s0_text_a3,'String',nalezene0{pa2},'Visible','On');
                    set(handles.s0_edit_a3,'Visible','On');
                else
                    if(pa2 == 4)
                        set(handles.s0_text_a4,'String',nalezene0{pa2},'Visible','On');
                        set(handles.s0_edit_a4,'Visible','On');
                    else
                        if(pa2 == 5)
                            set(handles.s0_text_a5,'String',nalezene0{pa2},'Visible','On');
                            set(handles.s0_edit_a5,'Visible','On');
                        else
                            if(pa2 == 6)
                                set(handles.s0_text_a6,'String',nalezene0{pa2},'Visible','On');
                                set(handles.s0_edit_a6,'Visible','On');
                            else
                                if(pa2 == 7)
                                    set(handles.s0_text_a7,'String',nalezene0{pa2},'Visible','On');
                                    set(handles.s0_edit_a7,'Visible','On');
                                else
                                    if(pa2 == 8)
                                        set(handles.s0_text_a8,'String',nalezene0{pa2},'Visible','On');
                                        set(handles.s0_edit_a8,'Visible','On');
                                    else
                                        if(pa2 == 9)
                                            set(handles.s0_text_a9,'String',nalezene0{pa2},'Visible','On');
                                            set(handles.s0_edit_a9,'Visible','On');
                                        else
                                            if(pa2 == 10)
                                                set(handles.s0_text_a10,'String',nalezene0{pa2},'Visible','On');
                                                set(handles.s0_edit_a10,'Visible','On');
                                            else
                                                msgbox('Bylo zadáno více než 10 parametrů Alfa.','Chyba!');
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
else
    
    % Je-li pouzit dvoupolovy model pro vypocet (s2)
    if (get(handles.pol2,'Value') == get(handles.pol2,'Max'))
        
        % Zobrazeni tolika objektu, kolik bylo nalezeno Alfa (s2)
        pa1x = length(nalezene2);
        for pa1 = 1:pa1x
            if(pa1 == 1)
                set(handles.s2_text_a1,'String',nalezene2{pa1},'Visible','On');
                set(handles.s2_edit_a1,'Visible','On');
            else
                if(pa1 == 2)
                    set(handles.s2_text_a2,'String',nalezene2{pa1},'Visible','On');
                    set(handles.s2_edit_a2,'Visible','On');
                else
                    if(pa1 == 3)
                        set(handles.s2_text_a3,'String',nalezene2{pa1},'Visible','On');
                        set(handles.s2_edit_a3,'Visible','On');
                    else
                        if(pa1 == 4)
                            set(handles.s2_text_a4,'String',nalezene2{pa1},'Visible','On');
                            set(handles.s2_edit_a4,'Visible','On');
                        else
                            if(pa1 == 5)
                                set(handles.s2_text_a5,'String',nalezene2{pa1},'Visible','On');
                                set(handles.s2_edit_a5,'Visible','On');
                            else
                                if(pa1 == 6)
                                    set(handles.s2_text_a6,'String',nalezene2{pa1},'Visible','On');
                                    set(handles.s2_edit_a6,'Visible','On');
                                else
                                    if(pa1 == 7)
                                        set(handles.s2_text_a7,'String',nalezene2{pa1},'Visible','On');
                                        set(handles.s2_edit_a7,'Visible','On');
                                    else
                                        if(pa1 == 8)
                                            set(handles.s2_text_a8,'String',nalezene2{pa1},'Visible','On');
                                            set(handles.s2_edit_a8,'Visible','On');
                                        else
                                            if(pa1 == 9)
                                                set(handles.s2_text_a9,'String',nalezene2{pa1},'Visible','On');
                                                set(handles.s2_edit_a9,'Visible','On');
                                            else
                                                if(pa1 == 10)
                                                    set(handles.s2_text_a10,'String',nalezene2{pa1},'Visible','On');
                                                    set(handles.s2_edit_a10,'Visible','On');
                                                else
                                                    msgbox('Bylo zadáno více než 10 parametrů Alfa.','Chyba!');
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
        pa2x = length(nalezene0);
        for pa2 = 1:pa2x                       % (s0)
            if(pa2 == 1)
                set(handles.s0_text_a1,'String',nalezene0{pa2},'Visible','On');
                set(handles.s0_edit_a1,'Visible','On');
            else
                if(pa2 == 2)
                    set(handles.s0_text_a2,'String',nalezene0{pa2},'Visible','On');
                    set(handles.s0_edit_a2,'Visible','On');
                else
                    if(pa2 == 3)
                        set(handles.s0_text_a3,'String',nalezene0{pa2},'Visible','On');
                        set(handles.s0_edit_a3,'Visible','On');
                    else
                        if(pa2 == 4)
                            set(handles.s0_text_a4,'String',nalezene0{pa2},'Visible','On');
                            set(handles.s0_edit_a4,'Visible','On');
                        else
                            if(pa2 == 5)
                                set(handles.s0_text_a5,'String',nalezene0{pa2},'Visible','On');
                                set(handles.s0_edit_a5,'Visible','On');
                            else
                                if(pa2 == 6)
                                    set(handles.s0_text_a6,'String',nalezene0{pa2},'Visible','On');
                                    set(handles.s0_edit_a6,'Visible','On');
                                else
                                    if(pa2 == 7)
                                        set(handles.s0_text_a7,'String',nalezene0{pa2},'Visible','On');
                                        set(handles.s0_edit_a7,'Visible','On');
                                    else
                                        if(pa2 == 8)
                                            set(handles.s0_text_a8,'String',nalezene0{pa2},'Visible','On');
                                            set(handles.s0_edit_a8,'Visible','On');
                                        else
                                            if(pa2 == 9)
                                                set(handles.s0_text_a9,'String',nalezene0{pa2},'Visible','On');
                                                set(handles.s0_edit_a9,'Visible','On');
                                            else
                                                if(pa2 == 10)
                                                    set(handles.s0_text_a10,'String',nalezene0{pa2},'Visible','On');
                                                    set(handles.s0_edit_a10,'Visible','On');
                                                else
                                                    msgbox('Bylo zadáno více než 10 parametrů Alfa.','Chyba!');
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    else
        msgbox('Zvolte jeden ze způsobu výpočtu.','Chyba!');
    end
end

% Zviditelneni pevnych objektu v casti 3
set(handles.text_3_1,'Visible','On');
set(handles.text_3_2,'Visible','On');
set(handles.text_3_3,'String',(pa1x+pa2x),'Visible','On');
set(handles.text_3_4,'Visible','On');
set(handles.text_3_5,'Visible','On');
set(handles.text_3_6,'Visible','On');
set(handles.text_3_7,'Visible','On');
set(handles.checkbox1,'Visible','On');
set(handles.pushbutton2,'Visible','On');
set(handles.edit_a,'Visible','On');

set(handles.text_pom1,'String',pa1x);
set(handles.text_pom2,'String',pa2x);

% Aktualizace GUI dat
guidata(hObject, handles);




function s2_edit_a1_Callback(hObject, eventdata, handles)


function s2_edit_a1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a2_Callback(hObject, eventdata, handles)


function s2_edit_a2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a3_Callback(hObject, eventdata, handles)


function s2_edit_a3_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a4_Callback(hObject, eventdata, handles)


function s2_edit_a4_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a5_Callback(hObject, eventdata, handles)


function s2_edit_a5_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a6_Callback(hObject, eventdata, handles)


function s2_edit_a6_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a7_Callback(hObject, eventdata, handles)


function s2_edit_a7_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a8_Callback(hObject, eventdata, handles)


function s2_edit_a8_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a9_Callback(hObject, eventdata, handles)


function s2_edit_a9_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s2_edit_a10_Callback(hObject, eventdata, handles)


function s2_edit_a10_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function checkbox1_Callback(hObject, eventdata, handles)


function edit_a_Callback(hObject, eventdata, handles)


function edit_a_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function pushbutton2_Callback(hObject, eventdata, handles)


global x1;

% Symbolicka deklarace
syms omega_alfa Q s omega_0;
syms s2_alfa s2_alfa1 s2_alfa2 s2_alfa3 s2_alfa4 s2_alfa5 s2_alfa6 s2_alfa7 s2_alfa8 s2_alfa9 s2_alfa10;
syms s0_alfa s0_alfa1 s0_alfa2 s0_alfa3 s0_alfa4 s0_alfa5 s0_alfa6 s0_alfa7 s0_alfa8 s0_alfa9 s0_alfa10;

% Naplneni promenych obsahem bunek
s2 = get(handles.edit1,'String');
s0 = get(handles.edit3,'String');

% Definice prohledavanych oblasti
zaklad_s2 = sprintf('%s', s2);
zaklad_s0 = sprintf('%s', s0);

% Specifikovani hledanych znaku
hledam = '([A]\d)';
nalezene_s2 = unique(regexpi(zaklad_s2, hledam, 'match'));
nalezene_s0 = unique(regexpi(zaklad_s0, hledam, 'match'));

% Osetreni
pocet_alfa_s2 = 0;
pocet_alfa_s0 = 0;
pom1 = get(handles.text_pom1,'String');
pom2 = get(handles.text_pom2,'String');
s2_p1_a = 1;
s2_p2_a = 1;
s0_p1_a = 1;
s0_p2_a = 1;
s2_p1_a1 = 1;
s2_p1_a2 = 1;
s2_p1_a3 = 1;
s2_p1_a4 = 1;
s2_p1_a5 = 1;
s2_p1_a6 = 1;
s2_p1_a7 = 1;
s2_p1_a8 = 1;
s2_p1_a9 = 1;
s2_p1_a10 = 1;
s2_p2_a1 = 1;
s2_p2_a2 = 1;
s2_p2_a3 = 1;
s2_p2_a4 = 1;
s2_p2_a5 = 1;
s2_p2_a6 = 1;
s2_p2_a7 = 1;
s2_p2_a8 = 1;
s2_p2_a9 = 1;
s2_p2_a10 = 1;
s0_p1_a1 = 1;
s0_p1_a2 = 1;
s0_p1_a3 = 1;
s0_p1_a4 = 1;
s0_p1_a5 = 1;
s0_p1_a6 = 1;
s0_p1_a7 = 1;
s0_p1_a8 = 1;
s0_p1_a9 = 1;
s0_p1_a10 = 1;
s0_p2_a1 = 1;
s0_p2_a2 = 1;
s0_p2_a3 = 1;
s0_p2_a4 = 1;
s0_p2_a5 = 1;
s0_p2_a6 = 1;
s0_p2_a7 = 1;
s0_p2_a8 = 1;
s0_p2_a9 = 1;
s0_p2_a10 = 1;

% Je-li pouzit jednopolovy model pro vypocet (s2)
if (get(handles.pol1,'Value') == get(handles.pol1,'Max'))
    if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
        s2_p1_a = s2_alfa/(1+((1/omega_alfa)*s));
    else
        % Zobrazeni tolika objektu, kolik bylo nalezeno Alfa (s2)
        pocet_a_s2 = length(nalezene_s2);
        for pocet_alfa_s2 = 1:pocet_a_s2
            if(pocet_alfa_s2 == 1)
                s2_p1_a1 = s2_alfa1/(1+((1/omega_alfa)*s));
            else
                if(pocet_alfa_s2 == 2)
                    s2_p1_a2 = s2_alfa2/(1+((1/omega_alfa)*s));
                else
                    if(pocet_alfa_s2 == 3)
                        s2_p1_a3 = s2_alfa3/(1+((1/omega_alfa)*s));
                    else
                        if(pocet_alfa_s2 == 4)
                            s2_p1_a4 = s2_alfa4/(1+((1/omega_alfa)*s));
                        else
                            if(pocet_alfa_s2 == 5)
                                s2_p1_a5 = s2_alfa5/(1+((1/omega_alfa)*s));
                            else
                                if(pocet_alfa_s2 == 6)
                                    s2_p1_a6 = s2_alfa6/(1+((1/omega_alfa)*s));
                                else
                                    if(pocet_alfa_s2 == 7)
                                        s2_p1_a7 = s2_alfa7/(1+((1/omega_alfa)*s));
                                    else
                                        if(pocet_alfa_s2 == 8)
                                            s2_p1_a8 = s2_alfa8/(1+((1/omega_alfa)*s));
                                        else
                                            if(pocet_alfa_s2 == 9)
                                                s2_p1_a9 = s2_alfa9/(1+((1/omega_alfa)*s));
                                            else
                                                if(pocet_alfa_s2 == 10)
                                                    s2_p1_a10 = s2_alfa10/(1+((1/omega_alfa)*s));
                                                else
                                                    msgbox('Bylo zadáno více než 10 parametrů Alfa.','Chyba!');
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
else
    
    % Je-li pouzit dvoupolovy model pro vypocet (s2)
    if (get(handles.pol2,'Value') == get(handles.pol2,'Max'))
        if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
            s2_p2_a = s2_alfa*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
        else
            % Zobrazeni tolika objektu, kolik bylo nalezeno Alfa (s2)
            pocet_a_s2 = length(nalezene_s2);
            for pocet_alfa_s2 = 1:pocet_a_s2
                if(pocet_alfa_s2 == 1)
                    s2_p2_a1 = s2_alfa1*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                else
                    if(pocet_alfa_s2 == 2)
                        s2_p2_a2 = s2_alfa2*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                    else
                        if(pocet_alfa_s2 == 3)
                            s2_p2_a3 = s2_alfa3*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                        else
                            if(pocet_alfa_s2 == 4)
                                s2_p2_a4 = s2_alfa4*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                            else
                                if(pocet_alfa_s2 == 5)
                                    s2_p2_a5 = s2_alfa5*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                else
                                    if(pocet_alfa_s2 == 6)
                                        s2_p2_a6 = s2_alfa6*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                    else
                                        if(pocet_alfa_s2 == 7)
                                            s2_p2_a7 = s2_alfa7*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                        else
                                            if(pocet_alfa_s2 == 8)
                                                s2_p2_a8 = s2_alfa8*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                            else
                                                if(pocet_alfa_s2 == 9)
                                                    s2_p2_a9 = s2_alfa9*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                                else
                                                    if(pocet_alfa_s2 == 10)
                                                        s2_p2_a10 = s2_alfa10*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                                    else
                                                        msgbox('Bylo zadáno více než 10 parametrů Alfa.','Chyba!');
                                                    end
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    else
    end
end

% Je-li pouzit jednopolovy model pro vypocet (s0)
if (get(handles.pol1,'Value') == get(handles.pol1,'Max'))
    if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
        s0_p1_a = s0_alfa/(1+((1/omega_alfa)*s));
    else
        % Zobrazeni tolika objektu, kolik bylo nalezeno Alfa (s0)
        pocet_a_s0 = length(nalezene_s0);
        for pocet_alfa_s0 = 1:pocet_a_s0
            if(pocet_alfa_s0 == 1)
                s0_p1_a1 = s0_alfa1/(1+((1/omega_alfa)*s));
            else
                if(pocet_alfa_s0 == 2)
                    s0_p1_a2 = s0_alfa2/(1+((1/omega_alfa)*s));
                else
                    if(pocet_alfa_s0 == 3)
                        s0_p1_a3 = s0_alfa3/(1+((1/omega_alfa)*s));
                    else
                        if(pocet_alfa_s0 == 4)
                            s0_p1_a4 = s0_alfa4/(1+((1/omega_alfa)*s));
                        else
                            if(pocet_alfa_s0 == 5)
                                s0_p1_a5 = s0_alfa5/(1+((1/omega_alfa)*s));
                            else
                                if(pocet_alfa_s0 == 6)
                                    s0_p1_a6 = s0_alfa6/(1+((1/omega_alfa)*s));
                                else
                                    if(pocet_alfa_s0 == 7)
                                        s0_p1_a7 = s0_alfa7/(1+((1/omega_alfa)*s));
                                    else
                                        if(pocet_alfa_s0 == 8)
                                            s0_p1_a8 = s0_alfa8/(1+((1/omega_alfa)*s));
                                        else
                                            if(pocet_alfa_s0 == 9)
                                                s0_p1_a9 = s0_alfa9/(1+((1/omega_alfa)*s));
                                            else
                                                if(pocet_alfa_s0 == 10)
                                                    s0_p1_a10 = s0_alfa10/(1+((1/omega_alfa)*s));
                                                else
                                                    msgbox('Bylo zadáno více než 10 parametrů Alfa.','Chyba!');
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    end
else
    
    % Je-li pouzit dvoupolovy model pro vypocet (s0)
    if (get(handles.pol2,'Value') == get(handles.pol2,'Max'))
        if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
            s0_p2_a = s0_alfa*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
        else
            % Zobrazeni tolika objektu, kolik bylo nalezeno Alfa (s0)
            pocet_a_s0 = length(nalezene_s0);
            for pocet_alfa_s0 = 1:pocet_a_s0
                if(pocet_alfa_s0 == 1)
                    s0_p2_a1 = s0_alfa1*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                else
                    if(pocet_alfa_s0 == 2)
                        s0_p2_a2 = s0_alfa2*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                    else
                        if(pocet_alfa_s0 == 3)
                            s0_p2_a3 = s0_alfa3*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                        else
                            if(pocet_alfa_s0 == 4)
                                s0_p2_a4 = s0_alfa4*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                            else
                                if(pocet_alfa_s0 == 5)
                                    s0_p2_a5 = s0_alfa5*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                else
                                    if(pocet_alfa_s0 == 6)
                                        s0_p2_a6 = s0_alfa6*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                    else
                                        if(pocet_alfa_s0 == 7)
                                            s0_p2_a7 = s0_alfa7*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                        else
                                            if(pocet_alfa_s0 == 8)
                                                s0_p2_a8 = s0_alfa8*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                            else
                                                if(pocet_alfa_s0 == 9)
                                                    s0_p2_a9 = s0_alfa9*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                                else
                                                    if(pocet_alfa_s0 == 10)
                                                        s0_p2_a10 = s0_alfa10*(omega_alfa^2)/((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2));
                                                    else
                                                        msgbox('Bylo zadáno více než 10 parametrů Alfa.','Chyba!');
                                                    end
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end
                    end
                end
            end
        end
    else
    end
end

s2_p1_all = s2_p1_a1*s2_p1_a2*s2_p1_a3*s2_p1_a4*s2_p1_a5*s2_p1_a6*s2_p1_a7*s2_p1_a8*s2_p1_a9*s2_p1_a10;
s2_p2_all = s2_p2_a1*s2_p2_a2*s2_p2_a3*s2_p2_a4*s2_p2_a5*s2_p2_a6*s2_p2_a7*s2_p2_a8*s2_p2_a9*s2_p2_a10;
s0_p1_all = s0_p1_a1*s0_p1_a2*s0_p1_a3*s0_p1_a4*s0_p1_a5*s0_p1_a6*s0_p1_a7*s0_p1_a8*s0_p1_a9*s0_p1_a10;
s0_p2_all = s0_p2_a1*s0_p2_a2*s0_p2_a3*s0_p2_a4*s0_p2_a5*s0_p2_a6*s0_p2_a7*s0_p2_a8*s0_p2_a9*s0_p2_a10;

p1_rov_a = 0;
p1_rov_all = 0;
p2_rov_a = 0;
p2_rov_all = 0;

if (get(handles.pol1,'Value') == get(handles.pol1,'Max'))
    if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
        %p1_rov_a = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p1_a^pom2)/(s2_p1_a^pom1))*omega_0)^2);
        
        if (pom1 > pom2)
            mezi = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p1_a^pom2)/(s2_p1_a^pom1))*omega_0)^2)*Q*((pom1 - pom2)^s2_alfa);
        end
        
        if (pom1 < pom2)
            mezi = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p1_a^pom2)/(s2_p1_a^pom1))*omega_0)^2)*Q*((pom2 - pom1)^(1+((1/omega_alfa)*s)));
        end
        
        if (pom1 == pom2)
            mezi = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p1_a^pom2)/(s2_p1_a^pom1))*omega_0)^2)*Q;
        end
        
        mezi2 = numden(mezi);
        vysl = collect(mezi2);
        [x1,x2] = coeffs(evalin(symengine,['numer(' char(vysl) ')']),s);
        %[y1,y2] = coeffs(evalin(symengine,['denom(' char(vysl) ')']),s);
        
    else
        p1_rov_all = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p1_all)/(s2_p1_all))*omega_0)^2);
    end
    
else
    if (get(handles.pol2,'Value') == get(handles.pol2,'Max'))
        if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
            %p2_rov_a = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p2_a^pom2)/(s2_p2_a^pom1))*omega_0)^2);
            
            if (pom1 > pom2)
                mezi = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p2_a^pom2)/(s2_p2_a^pom1))*omega_0)^2)*Q*((pom1 - pom2)^(s2_alfa*omega_alfa^2));
            end
            
            if (pom1 < pom2)
                mezi = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p2_a^pom2)/(s2_p2_a^pom1))*omega_0)^2)*Q*((pom2 - pom1)^((s^2)+(s*omega_alfa/0.707)+(omega_alfa^2)));
            end
            
            if (pom1 == pom2)
                mezi = ((s^2)+(s*(omega_0/Q))+(sqrt((s0_p2_a^pom2)/(s2_p2_a^pom1))*omega_0)^2)*Q;
            end
            
            mezi2 = numden(mezi);
            vysl = collect(mezi2);
            [x1,x2] = coeffs(evalin(symengine,['numer(' char(vysl) ')']),s);
            %[y1,y2] = coeffs(evalin(symengine,['denom(' char(vysl) ')']),s);
            
        else
            p2_rov_all = collect((s^2)+(s*(omega_0/Q))+(sqrt((s0_p2_all)/(s2_p2_all))*omega_0)^2);
        end
    else
        msgbox('Nejprve zvolte jeden ze způsobu výpočtu výše.','Chyba!');
    end
end

if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
    % OK
else
    msgbox('Checkbox musí zůstat zatržen, protože tato verze programu neumí pracovat s rozdílnými hodnotami přesosu aktivního prvku!','Chyba!');
end

set(handles.panel4,'Visible','On');
set(handles.panel4_1,'Visible','On');
set(handles.panel5,'Visible','On');
set(handles.panel5_1,'Visible','On');
set(handles.panel6,'Visible','On');
set(handles.panel6_1,'Visible','On');
set(handles.panel7,'Visible','On');
set(handles.panel7_1,'Visible','On');
set(handles.panel8,'Visible','On');
set(handles.panel9,'Visible','On');

% Aktualizace GUI dat
guidata(hObject, handles);


function s0_edit_a1_Callback(hObject, eventdata, handles)


function s0_edit_a1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a2_Callback(hObject, eventdata, handles)


function s0_edit_a2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a3_Callback(hObject, eventdata, handles)


function s0_edit_a3_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a4_Callback(hObject, eventdata, handles)


function s0_edit_a4_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a5_Callback(hObject, eventdata, handles)


function s0_edit_a5_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a6_Callback(hObject, eventdata, handles)


function s0_edit_a6_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a7_Callback(hObject, eventdata, handles)


function s0_edit_a7_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a8_Callback(hObject, eventdata, handles)


function s0_edit_a8_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a9_Callback(hObject, eventdata, handles)


function s0_edit_a9_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function s0_edit_a10_Callback(hObject, eventdata, handles)


function s0_edit_a10_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit27_Callback(hObject, eventdata, handles)


function edit27_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit28_Callback(hObject, eventdata, handles)


function edit28_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_4_1_Callback(hObject, eventdata, handles)


function edit_4_1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_4_3_Callback(hObject, eventdata, handles)


function edit_4_3_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_4_2_Callback(hObject, eventdata, handles)


function edit_4_2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_7_1_Callback(hObject, eventdata, handles)


function edit_7_1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit37_Callback(hObject, eventdata, handles)


function edit37_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_7_2_Callback(hObject, eventdata, handles)


function edit_7_2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_6_1_Callback(hObject, eventdata, handles)


function edit_6_1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_6_3_Callback(hObject, eventdata, handles)


function edit_6_3_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_6_2_Callback(hObject, eventdata, handles)


function edit_6_2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_5_1_Callback(hObject, eventdata, handles)


function edit_5_1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_5_3_Callback(hObject, eventdata, handles)


function edit_5_3_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_5_2_Callback(hObject, eventdata, handles)


function edit_5_2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_roz_Callback(hObject, eventdata, handles)


function edit_roz_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function edit_roz_y_Callback(hObject, eventdata, handles)


function edit_roz_y_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


function pushbutton3_Callback(hObject, eventdata, handles)

tStart = tic;

syms omega_alfa Q s omega_0 s0_alfa s2_alfa;

global x1;

osa4 = 0;
osa5 = 0;
osa6 = 0;
osa7 = 0;
osax4 = 0;
osax5 = 0;
osax6 = 0;
osax7 = 0;

if (get(handles.radio_4_1,'Value') == get(handles.radio_4_1,'Max'))
    osa4 = 1;
    if (get(handles.radio_4_11,'Value') == get(handles.radio_4_11,'Max'))
        osax4 = 1;
    end
end

if (get(handles.radio_5_1,'Value') == get(handles.radio_5_1,'Max'))
    osa5 = 1;
    if (get(handles.radio_5_11,'Value') == get(handles.radio_5_11,'Max'))
        osax5 = 1;
    end
end

if (get(handles.radio_6_1,'Value') == get(handles.radio_6_1,'Max'))
    osa6 = 1;
    if (get(handles.radio_6_11,'Value') == get(handles.radio_6_11,'Max'))
        osax6 = 1;
    end
end

if (get(handles.radio_7_1,'Value') == get(handles.radio_7_1,'Max'))
    osa7 = 1;
    if (get(handles.radio_7_11,'Value') == get(handles.radio_7_11,'Max'))
        osax7 = 1;
    end
end

osa = osa4 + osa5 + osa6 + osa7;
% osetreni parametru na osach
if (osa ~= 2)
    msgbox('Musí být dva parametry na osách a dva s pevnými hodnotami.','Chyba!');
else
    osax = osax4 + osax5 + osax6 + osax7;
    if (osax == 2)
        msgbox('Nemohou být dva parametry na jedné ose.','Chyba!');
    else
        if (get(handles.checkbox1,'Value') == get(handles.checkbox1,'Max'))
            
            value_4_od = str2double(get(handles.edit_4_1,'String'))+0.1; % osetreni
            value_4_do = str2double(get(handles.edit_4_2,'String'));
            value_4 = str2double(get(handles.edit_4_3,'String'));
            value_5_od = str2double(get(handles.edit_5_1,'String'))+0.1; % osetreni
            value_5_do = str2double(get(handles.edit_5_2,'String'));
            value_5 = str2double(get(handles.edit_5_3,'String'));
            value_6_od = str2double(get(handles.edit_6_1,'String'))+0.1; % osetreni
            value_6_do = str2double(get(handles.edit_6_2,'String'));
            value_6 = str2double(get(handles.edit_6_3,'String'));
            value_7_od = str2double(get(handles.edit_7_1,'String'))+0.1; % osetreni
            value_7_do = str2double(get(handles.edit_7_2,'String'));
            value_7 = str2double(get(handles.edit_a,'String'));
            
            % pouzite rozliseni pro vykresleni (dostacuje 200 - 300)
            rozliseni = str2double(get(handles.edit_roz,'String'));
            
            % naplneni zobrazovane "barevne mapy" vychozimi nulami
            mapa = zeros(rozliseni);
            
            % vstupni vektor s koeficienty
            vektor = x1;
            %vektor = [1/omega_alfa, 1+(omega_0/Q*omega_alfa), omega_0/Q, s0_alfa*omega_0^2];
            % zjisteni poctu koeficientu
            delka = length(vektor);
            
            % rozdeleni koeficientu na "sude" a "liche"
            sude = vektor(1:2:delka);
            liche = vektor(2:2:delka);
            
            % srovnani delky vektoru lichych (pokud je potreba)
            if(length(sude) > length(liche))
                liche = [liche 0];
            end
            
            % vytvoreni zakladu matice z koeficientu
            matice = [sude; liche];
            
            % doplneni zbytku matice nulami
            nuly = zeros(length(sude));
            [radky2, sloupce2] = size(nuly);
            matice = [matice; nuly];
            
            % zjisteni velikosti matice
            [radky, sloupce] = size(matice);
            
            % pro 3. a nasledujici radky
            for i = 3:radky
                % zjisti "leve" prvky
                lt = matice(i-2, 1);
                lb = matice(i-1, 1);
                
                % pro 2. a nasledujici sloupce
                for j = 2:sloupce
                    % zjisti "prave" prvky
                    rt = matice(i-2, j);
                    rb = matice(i-1, j);
                    
                    % vypocet noveho prvku
                    aktualni = (lb*rt - lt*rb)/lb;
                    
                    % ulozeni noveho prvku do matice
                    matice(i, j-1) = aktualni;
                    
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_5_1,'Value') == get(handles.radio_5_1,'Max'))
                if (get(handles.radio_5_11,'Value') == get(handles.radio_5_11,'Max'))
                    if (get(handles.radio_7_1,'Value') == get(handles.radio_7_1,'Max'))
                        if (get(handles.radio_7_12,'Value') == get(handles.radio_7_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4 value_6 value_5_od 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4 value_6 value_5_od 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4 value_6 value_5_do 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4 value_6 value_5_do 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for alfa_hodnota = linspace(value_7_od, value_7_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for omega_hodnota = linspace(value_5_od, value_5_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [alfa_hodnota alfa_hodnota value_4 value_6 omega_hodnota 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_5_od value_5_do value_7_od value_7_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('omega_0 [rad/s]')
                                    ylabel('alfa_0')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_7_1,'Value') == get(handles.radio_7_1,'Max'))
                if (get(handles.radio_7_11,'Value') == get(handles.radio_7_11,'Max'))
                    if (get(handles.radio_5_1,'Value') == get(handles.radio_5_1,'Max'))
                        if (get(handles.radio_5_12,'Value') == get(handles.radio_5_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4 value_6 value_5_od 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4 value_6 value_5_od 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4 value_6 value_5_do 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4 value_6 value_5_do 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for omega_hodnota = linspace(value_5_od, value_5_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for alfa_hodnota = linspace(value_7_od, value_7_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [alfa_hodnota alfa_hodnota value_4 value_6 omega_hodnota 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_7_od value_7_do value_5_od value_5_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('alfa_0')
                                    ylabel('omega_0 [rad/s]')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_7_1,'Value') == get(handles.radio_7_1,'Max'))
                if (get(handles.radio_7_11,'Value') == get(handles.radio_7_11,'Max'))
                    if (get(handles.radio_6_1,'Value') == get(handles.radio_6_1,'Max'))
                        if (get(handles.radio_6_12,'Value') == get(handles.radio_6_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4 value_6_od value_5 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4 value_6_od value_5 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4 value_6_do value_5 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4 value_6_do value_5 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for Q_hodnota = linspace(value_6_od, value_6_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for alfa_hodnota = linspace(value_7_od, value_7_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [alfa_hodnota alfa_hodnota value_4 Q_hodnota value_5 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_7_od value_7_do value_6_od value_6_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('alfa_0')
                                    ylabel('Q')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_6_1,'Value') == get(handles.radio_6_1,'Max'))
                if (get(handles.radio_6_11,'Value') == get(handles.radio_6_11,'Max'))
                    if (get(handles.radio_7_1,'Value') == get(handles.radio_7_1,'Max'))
                        if (get(handles.radio_7_12,'Value') == get(handles.radio_7_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4 value_6_od value_5 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4 value_6_od value_5 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4 value_6_do value_5 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4 value_6_do value_5 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for alfa_hodnota = linspace(value_7_od, value_7_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for Q_hodnota = linspace(value_6_od, value_6_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [alfa_hodnota alfa_hodnota value_4 Q_hodnota value_5 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_6_od value_6_do value_7_od value_7_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('Q')
                                    ylabel('alfa_0')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_4_1,'Value') == get(handles.radio_4_1,'Max'))
                if (get(handles.radio_4_11,'Value') == get(handles.radio_4_11,'Max'))
                    if (get(handles.radio_7_1,'Value') == get(handles.radio_7_1,'Max'))
                        if (get(handles.radio_7_12,'Value') == get(handles.radio_7_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4_od value_6 value_5 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4_od value_6 value_5 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4_do value_6 value_5 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4_do value_6 value_5 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for alfa_hodnota = linspace(value_7_od, value_7_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for tau_hodnota = linspace(value_4_od, value_4_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [alfa_hodnota alfa_hodnota tau_hodnota value_6 value_5 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_4_od value_4_do value_7_od value_7_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('omega alfa [rad/s]')
                                    ylabel('alfa_0')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_7_1,'Value') == get(handles.radio_7_1,'Max'))
                if (get(handles.radio_7_11,'Value') == get(handles.radio_7_11,'Max'))
                    if (get(handles.radio_4_1,'Value') == get(handles.radio_4_1,'Max'))
                        if (get(handles.radio_4_12,'Value') == get(handles.radio_4_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4_od value_6 value_5 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4_od value_6 value_5 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_od value_7_od value_4_do value_6 value_5 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7_do value_7_do value_4_do value_6 value_5 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for tau_hodnota = linspace(value_4_od, value_4_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for alfa_hodnota = linspace(value_7_od, value_7_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [alfa_hodnota alfa_hodnota tau_hodnota value_6 value_5 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_7_od value_7_do value_4_od value_4_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('alfa_0')
                                    ylabel('omega alfa [rad/s]')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_6_1,'Value') == get(handles.radio_6_1,'Max'))
                if (get(handles.radio_6_11,'Value') == get(handles.radio_6_11,'Max'))
                    if (get(handles.radio_5_1,'Value') == get(handles.radio_5_1,'Max'))
                        if (get(handles.radio_5_12,'Value') == get(handles.radio_5_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 value_6_od value_5_od 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 value_6_do value_5_od 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 value_6_od value_5_do 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 value_6_do value_5_do 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for omega_hodnota = linspace(value_5_od, value_5_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for Q_hodnota = linspace(value_6_od, value_6_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 Q_hodnota omega_hodnota 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_6_od value_6_do value_5_od value_5_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('Q')
                                    ylabel('omega_0 [rad/s]')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_5_1,'Value') == get(handles.radio_5_1,'Max'))
                if (get(handles.radio_5_11,'Value') == get(handles.radio_5_11,'Max'))
                    if (get(handles.radio_6_1,'Value') == get(handles.radio_6_1,'Max'))
                        if (get(handles.radio_6_12,'Value') == get(handles.radio_6_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 value_6_od value_5_od 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 value_6_do value_5_od 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 value_6_od value_5_do 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 value_6_do value_5_do 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for Q_hodnota = linspace(value_6_od, value_6_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for omega_hodnota = linspace(value_5_od, value_5_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4 Q_hodnota omega_hodnota 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_5_od value_5_do value_6_od value_6_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('omega_0 [rad/s]')
                                    ylabel('Q')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_4_1,'Value') == get(handles.radio_4_1,'Max'))
                if (get(handles.radio_4_11,'Value') == get(handles.radio_4_11,'Max'))
                    if (get(handles.radio_6_1,'Value') == get(handles.radio_6_1,'Max'))
                        if (get(handles.radio_6_12,'Value') == get(handles.radio_6_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_od value_6_od value_5 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_od value_6_do value_5 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_do value_6_od value_5 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_do value_6_do value_5 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for Q_hodnota = linspace(value_6_od, value_6_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for tau_hodnota = linspace(value_4_od, value_4_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 tau_hodnota Q_hodnota value_5 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_4_od value_4_do value_6_od value_6_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('omega alfa [rad/s]')
                                    ylabel('Q')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_6_1,'Value') == get(handles.radio_6_1,'Max'))
                if (get(handles.radio_6_11,'Value') == get(handles.radio_6_11,'Max'))
                    if (get(handles.radio_4_1,'Value') == get(handles.radio_4_1,'Max'))
                        if (get(handles.radio_4_12,'Value') == get(handles.radio_4_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_od value_6_od value_5 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_od value_6_do value_5 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_do value_6_od value_5 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_do value_6_do value_5 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for tau_hodnota = linspace(value_4_od, value_4_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for Q_hodnota = linspace(value_6_od, value_6_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 tau_hodnota Q_hodnota value_5 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_6_od value_6_do value_4_od value_4_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('Q')
                                    ylabel('omega alfa [rad/s]')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_5_1,'Value') == get(handles.radio_5_1,'Max'))
                if (get(handles.radio_5_11,'Value') == get(handles.radio_5_11,'Max'))
                    if (get(handles.radio_4_1,'Value') == get(handles.radio_4_1,'Max'))
                        if (get(handles.radio_4_12,'Value') == get(handles.radio_4_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_od value_6 value_5_od 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_od value_6 value_5_do 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_do value_6 value_5_od 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_do value_6 value_5_do 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for tau_hodnota = linspace(value_4_od, value_4_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for omega_hodnota = linspace(value_5_od, value_5_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 tau_hodnota value_6 omega_hodnota 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_5_od value_5_do value_4_od value_4_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('omega_0 [rad/s]')
                                    ylabel('omega alfa [rad/s]')
                                end
                            end
                        end
                    end
                end
            end
            %------------------------------------------------------------------------
            if (get(handles.radio_4_1,'Value') == get(handles.radio_4_1,'Max'))
                if (get(handles.radio_4_11,'Value') == get(handles.radio_4_11,'Max'))
                    if (get(handles.radio_5_1,'Value') == get(handles.radio_5_1,'Max'))
                        if (get(handles.radio_5_12,'Value') == get(handles.radio_5_12,'Max'))
                            k1 = 1;
                            k2 = 1;
                            k3 = 1;
                            k4 = 1;
                            for ix1 = 3:radky
                                for jx1 = 1:sloupce
                                    vekt1 = matice(ix1,jx1);
                                    if subs(vekt1, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_od value_6 value_5_od 1]) < 0
                                        k1 = 0;
                                    end
                                end
                            end
                            for ix2 = 3:radky
                                for jx2 = 1:sloupce
                                    vekt2 = matice(ix2,jx2);
                                    if subs(vekt2, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_od value_6 value_5_do 1]) < 0
                                        k2 = 0;
                                    end
                                end
                            end
                            for ix3 = 3:radky
                                for jx3 = 1:sloupce
                                    vekt3 = matice(ix3,jx3);
                                    if subs(vekt3, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_do value_6 value_5_od 1]) < 0
                                        k3 = 0;
                                    end
                                end
                            end
                            for ix4 = 3:radky
                                for jx4 = 1:sloupce
                                    vekt4 = matice(ix4,jx4);
                                    if subs(vekt4, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 value_4_do value_6 value_5_do 1]) < 0
                                        k4 = 0;
                                    end
                                end
                            end
                            kontrola = k1 + k2 + k3 + k4;
                            if (kontrola == 0)
                                msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                            else
                                if (kontrola == 4)
                                    msgbox('Pro zadané hodnoty nemá výpočet smysl, je třeba zadat jiné.','Chyba!');
                                else
                                    ii = 0;
                                    for omega_hodnota = linspace(value_5_od, value_5_do, rozliseni) % osa Y
                                        ii = ii+1;
                                        jj = 0;
                                        for tau_hodnota = linspace(value_4_od, value_4_do, rozliseni) % osa X
                                            jj = jj+1;
                                            vse = 1;
                                            for ix = 3:radky
                                                for jx = 1:sloupce
                                                    vekt = matice(ix,jx);
                                                    if subs(vekt, [s0_alfa s2_alfa omega_alfa Q omega_0 s], [value_7 value_7 tau_hodnota value_6 omega_hodnota 1]) < 0
                                                        vse = 0;
                                                    end
                                                end
                                            end
                                            if (vse == 1)
                                                mapa(ii, jj) = 1;
                                            end
                                        end
                                        disp(strcat('Hotovo:... ', int2str(ii), ' kroků z Vámi zadaného rozlišení.'));
                                    end
                                    figure
                                    hold on
                                    axis ([value_4_od value_4_do value_5_od value_5_do])
                                    axes
                                    imshow(mat2gray(flipud(mapa)))
                                    axis normal
                                    xlabel('omega alfa [rad/s]')
                                    ylabel('omega_0 [rad/s]')
                                end
                            end
                        end
                    end
                end
            end
            
            tEnd = toc(tStart);
            fprintf('Výpočet trval: %d minut a %f sekund\n',floor(tEnd/60),rem(tEnd,60));
            
        else
            msgbox('Checkbox musí zůstat zatržen, protože tato verze programu neumí pracovat s rozdílnými hodnotami přesosu aktivního prvku!','Chyba!');
        end
    end
end
