function varargout = complexfractal(varargin) % Построение комплексных (алгебраических) фракталов gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @complexfractal_OpeningFcn, ... 'gui_OutputFcn', @complexfractal_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 % End initialization code - DO NOT EDIT % --- Executes just before complexfractal is made visible. function complexfractal_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to complexfractal (see VARARGIN) % Choose default command line output for complexfractal handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes complexfractal wait for user response (see UIRESUME) % uiwait(handles.figure1); % --- Outputs from this function are returned to the command line. function varargout = complexfractal_OutputFcn(hObject, eventdata, handles) % varargout cell array for returning output args (see VARARGOUT); % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Get default command line output from handles structure varargout{1} = handles.output; % Связь события CloseRequestFcn с подфункцией Close set(handles.output, 'CloseRequestFcn',{@Close,handles}); function Close(hObject,eventdata,handles)% Подфункция обработки события CloseRequestFcn окна приложения % Вывод модального диалогового окна с подтверждением закрытия q=questdlg('Закрыть приложение?','!!Информация!!','Да','Нет','Да'); % Проверка выбора пользователя if strcmp(q,'Да') % Пользователь подтвердил закрытие приложения, % удаляем окно приложения delete(handles.output); end % --- Executes on button press in btnPlot. function btnPlot_Callback(hObject, eventdata, handles) % Определение номера выбранной строки Num = get(handles.pmType, 'Value'); if get(handles.cbInd,'Value'), flag1=1;else flag1=0;end; switch Num case 1 z0 = str2double(get(handles.EdtL,'String')); z1 = str2double(get(handles.EdtR,'String')); maxsteps= str2double(get(handles.EdtStep,'String')); hres = str2double(get(handles.EdtRes,'String')); mandel(z0,z1,maxsteps,hres,flag1); case 2 z0 = str2double(get(handles.EdtL,'String')); z1 = str2double(get(handles.EdtR,'String')); maxsteps= str2double(get(handles.EdtStep,'String')); hres = str2double(get(handles.EdtRes,'String')); c = str2double(get(handles.EdtC,'String')); julia(c,z0,z1,maxsteps,hres,flag1); case 3 maxsteps= str2double(get(handles.EdtStep,'String')); newton(maxsteps); end function EdtL_Callback(hObject, eventdata, handles) % hObject handle to EdtL (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of EdtL as text % str2double(get(hObject,'String')) returns contents of EdtL as a double % --- Executes during object creation, after setting all properties. function EdtL_CreateFcn(hObject, eventdata, handles) % hObject handle to EdtL (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function EdtR_Callback(hObject, eventdata, handles) % hObject handle to EdtR (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of EdtR as text % str2double(get(hObject,'String')) returns contents of EdtR as a double % --- Executes during object creation, after setting all properties. function EdtR_CreateFcn(hObject, eventdata, handles) % hObject handle to EdtR (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function EdtStep_Callback(hObject, eventdata, handles) % hObject handle to EdtStep (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of EdtStep as text % str2double(get(hObject,'String')) returns contents of EdtStep as a double % --- Executes during object creation, after setting all properties. function EdtStep_CreateFcn(hObject, eventdata, handles) % hObject handle to EdtStep (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end function EdtRes_Callback(hObject, eventdata, handles) % hObject handle to EdtRes (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of EdtRes as text % str2double(get(hObject,'String')) returns contents of EdtRes as a double % --- Executes during object creation, after setting all properties. function EdtRes_CreateFcn(hObject, eventdata, handles) % hObject handle to EdtRes (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in pushbutton2. function pushbutton2_Callback(hObject, eventdata, handles) % hObject handle to pushbutton2 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % --- Executes on button press in CbDefault. function CbDefault_Callback(hObject, eventdata, handles) % hObject handle to CbDefault (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of CbDefault function EdtC_Callback(hObject, eventdata, handles) % hObject handle to EdtC (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: get(hObject,'String') returns contents of EdtC as text % str2double(get(hObject,'String')) returns contents of EdtC as a double % --- Executes during object creation, after setting all properties. function EdtC_CreateFcn(hObject, eventdata, handles) % hObject handle to EdtC (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: edit controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on selection change in pmType. function pmType_Callback(hObject, eventdata, handles) % hObject handle to pmType (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns pmType contents as cell array % contents{get(hObject,'Value')} returns selected item from pmType % Определение номера выбранной строки Num = get(hObject, 'Value'); switch Num case 1 % Выбрана первая строка set(handles.EdtL, 'visible', 'on'); set(handles.EdtR, 'visible', 'on'); set(handles.EdtRes, 'visible', 'on'); set(handles.EdtC, 'visible', 'on'); set(handles.textL, 'visible', 'on'); set(handles.textR, 'visible', 'on'); set(handles.textRes, 'visible', 'on'); set(handles.EdtC, 'visible', 'off'); set(handles.textC, 'visible', 'off'); case 2 % Выбрана вторая строка set(handles.EdtL, 'visible', 'on'); set(handles.EdtR, 'visible', 'on'); set(handles.EdtRes, 'visible', 'on'); set(handles.EdtC, 'visible', 'on'); set(handles.textL, 'visible', 'on'); set(handles.textR, 'visible', 'on'); set(handles.textRes, 'visible', 'on'); set(handles.EdtC, 'visible', 'on'); set(handles.textC, 'visible', 'on'); case 3 % Выбрана третья строка set(handles.EdtL, 'visible', 'off'); set(handles.EdtR, 'visible', 'off'); set(handles.EdtRes, 'visible', 'off'); set(handles.textL, 'visible', 'off'); set(handles.textR, 'visible', 'off'); set(handles.textRes, 'visible', 'off'); set(handles.textC, 'visible', 'off'); set(handles.EdtC, 'visible', 'off'); set(handles.textC, 'visible', 'off'); end % --- Executes during object creation, after setting all properties. function pmType_CreateFcn(hObject, eventdata, handles) % hObject handle to pmType (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in btnDefault. function btnDefault_Callback(hObject, eventdata, handles) % hObject handle to btnDefault (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) Num = get(handles.pmType, 'Value'); switch Num case 1 % Выбрана первая строка set(handles.EdtL,'String','-0.745468+0.112979*i '); set(handles.EdtR,'String','-0.745385+0.113039*i') ; set(handles.EdtStep,'String','256') ; set(handles.EdtRes,'String','100'); case 2 % Выбрана вторая строка set(handles.EdtC,'String','-0.12+0.74i'); set(handles.EdtL,'String','-1.5-1.5i '); set(handles.EdtR,'String','1.5+1.5i') ; set(handles.EdtStep,'String','256') ; set(handles.EdtRes,'String','100'); case 3 % Выбрана третья строка set(handles.EdtStep,'String','1001') ; end % --- Executes on selection change in pmColor. function pmColor_Callback(hObject, eventdata, handles) % hObject handle to pmColor (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns pmColor contents as cell array % contents{get(hObject,'Value')} returns selected item from pmColor Num = get(handles.pmColor, 'Value'); switch Num case 1 % Выбрана первая строка, следует сделать линию colormap('default') case 2 % Выбрана вторая строка, следует сделать линию colormap(autumn) case 3 % Выбрана третья строка, следует сделать линию colormap(bone) case 4 colormap(cool) case 5 colormap(copper) case 6 colormap(flag) case 7 colormap(gray) case 8 colormap(hot) case 9 colormap(hsv) case 10 colormap( jet) case 11 colormap(prism) case 12 colormap(spring) case 13 colormap(summer) case 14 colormap( winter) case 15 colormap(colorcube) end % --- Executes during object creation, after setting all properties. function pmColor_CreateFcn(hObject, eventdata, handles) % hObject handle to pmColor (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: popupmenu controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) set(hObject,'BackgroundColor','white'); end % --- Executes on button press in cbInd. function cbInd_Callback(hObject, eventdata, handles) % hObject handle to cbInd (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hint: get(hObject,'Value') returns toggle state of cbInd