Question about creating a GUI
Afficher commentaires plus anciens
So I have the function for the mandelbrot set, and I also have a script to create a GUI. I cannot figure out how to get the image from the mandelbrot set to appear as the image in my GUI. Any help would be greatly appreciated.
Here is the script for the GUI:
function varargout = madelbrotset_gui(varargin)
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @madelbrotset_gui_OpeningFcn, ...
'gui_OutputFcn', @madelbrotset_gui_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 madelbrotset_gui_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
function varargout = madelbrotset_gui_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function reset_button_Callback(hObject, eventdata, handles)
function zoom_out_button_Callback(hObject, eventdata, handles)
function zoom_in_button_Callback(hObject, eventdata, handles)
function pan_up_button_Callback(hObject, eventdata, handles)
function pan_left_button_Callback(hObject, eventdata, handles)
function pan_right_button_Callback(hObject, eventdata, handles)
function pan_down_button_Callback(hObject, eventdata, handles)
end
end
end
end
end
end
end
end
end
end
here is the script for mandelbrot set:
clc
xmin=-1.5;
xmax=1;
ymin=-1.5;
ymax=1.5;
map=mandelset(xmin,xmax,ymin,ymax);
figure(1)
imagesc(map)
colormap(jet)
while(1)
disp('click the top left')
[x1,y1]=ginput(1)
disp('now click the bottom right')
[x2,y2]=ginput(1)
yminnew=(ymax-ymin)/511*y1+ymin;
xminnew=(xmax-xmin)/511*x1+xmin;
ymaxnew=(ymax-ymin)/511*y2+ymin;
xmaxnew=(xmax-xmin)/511*x2+xmin;
map=mandelset(xminnew,xmaxnew,yminnew,ymaxnew);
figure(1);
imagesc(map)
colormap(jet)
xmin=xminnew;
xmax=xmaxnew;
ymin=yminnew;
ymax=ymaxnew;
end
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur ROI-Based Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!