Matlab 版 (精华区)
发信人: zjliu (秋天的萝卜), 信区: Matlab
标 题: [合集]如何可以看到.fig文件的原.m文件?
发信站: 哈工大紫丁香 (2003年06月22日16:50:10 星期天), 站内信件
────────────────────────────────────────
simples (simple) 于 2003年06月12日09:13:36 星期四 说道:
就像simulink那样,用GUI做出来的界面是否会有对.fig文件进行描述的.m文件(不是它
的调用函数组成的.m文件)。因为我想把我做的界面变成.exe文件,但是Matlab编译器
不支持某些语言特征,我想通过删除.m文件中的某些语句来实现。
────────────────────────────────────────
zjliu (秋天的萝卜) 于 2003年06月12日10:18:32 星期四 说道:
fig文件应该是由m文件得到的,应该有m文件呀,
你是不是只有别人的fig文件?所以才问了这个问
题
────────────────────────────────────────
billsun (该学习了) 于 2003年06月12日13:51:29 星期四 说道:
把你得fig文件用m editor打开就行了
────────────────────────────────────────
angelfish (笨笨鱼) 于 2003年06月12日14:10:34 星期四 说道:
不行,我试了
乱码
────────────────────────────────────────
angelfish (笨笨鱼) 于 2003年06月12日14:11:03 星期四 说道:
fig直接用gui画的
────────────────────────────────────────
simples (simple) 于 2003年06月12日15:35:24 星期四 说道:
不是拉,
我自己做的界面,当时他产生一个.fig何.m文件,但是那个.m文件不是我想要的。
谢谢,帮忙想象把。:)
────────────────────────────────────────
zjliu (秋天的萝卜) 于 2003年06月12日16:21:07 星期四 说道:
你是什么样的图?
能不能贴出来让大家看看!
────────────────────────────────────────
simples (simple) 于 2003年06月12日21:37:56 星期四 说道:
好的,一起分享 ^_^;这是第一个文件address_book.m,下一张再贴它调用的子程序。
不过里面的查询健不好用,看看大家能不能帮我看看,^_^谢了
function varargout = address_book(varargin)
if nargin<=1 % NARGIN Number of function input arguments.
%GUI发布
fig=openfig(mfilename,'reuse');
set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));
handles=guihandles(fig);
guidata(fig,handles);
if nargin==0
%装入缺省的地址簿
Check_And_Load([],handles)
elseif exist(varargin{1},'file')
Check_And_Load(varargin{1},handles)
else
%如果文件不存在,则返回一个错误对话框并将文本设置为空字符串
errordlg('File Not Found','File Load Error')
set(handles.Contact_Name,'String','')
set(handles.Contact_Phone,'String','')
end
if nargout > 0
varargout{1} = fig;
end
elseif ischar(varargin{1}) % INVOKE NAMED SUBFUNCTION OR CALLBACK
try
[varargout{1:nargout}] = feval(varargin{:}); % FEVAL switchyard
catch
disp(lasterr);
end
end
function pass=Check_And_Load(file,handles)
%初始化变量pass以判断文件是否有效
pass=0;
%如果不指定文件名则使用缺名字,否则如果指定文件存在就装载它
if isempty(file)
file='addr.mat';
handles.LastFile=file;
guidata(handles.Address_Book,handles)
end
if exist(file)==2
data=load(file);
end
%判断MAT文件是否有效,当存在一个名为Addresses的变量并且其两个域名为Name,Phon
e时,该文件有效
flds=fieldnames(data);
if(length(flds)==1)&(strcmp(flds{1},'Addresses'))
fields=fieldnames(data.Addresses);
if(length(fields)==2)&(strcmp(fields{1},'Name'))&(strcmp(fields{2},'Phon
e'))
pass=1;
end
end
%如果文件有效则显示
if pass
%给句柄结构体添加地址
handles.Addresses=data.Addresses;
guidata(handles.Address_Book,handles)
%显示第一个条目
set(handles.Contact_Name,'String',data.Addresses(1).Name)
set(handles.Contact_Phone,'String',data.Addresses(1).Phone)
%将索引指针设置为1并保存句柄
handles.Index=1;
guidata(handles.Address_Book,handles)
else
errordlg('Not a valid Address Book','Address Book Error')
end
initial_dir=file;
set(handles.Path,'String',initial_dir);
Addresses=handles.Addresses;
Amount=length(Addresses);
set(handles.Amount,'String',Amount);
set(handles.Serial,'string',1);
% --------------------------------------------------------------------
function varargout = Address_Book_ResizeFcn(h, eventdata, handles, varargin)
% 获取窗口的尺寸和位置
Figure_Size=get(h,'Position');
%设置窗口的固有尺寸
Original_Size=[0 0 94 19.230769230769234];
%如果重画窗口小于固有窗口尺寸,实行补偿
if(Figure_Size(3)<Original_Size(3))|(Figure_Size(4)~=Original_Size(4))
if Figure_Size(3)<Original_Size(3)
%如果宽度过小则设置为固定宽度
set(h,'Position',[Figure_Size(1) Figure_Size(2) Original_Size(3) Origin
al_Size(4)])
Figure_Size=get(h,'Position');
end
if Figure_Size(4)~=Original_Size(4)
% 不容许修改高度
set(h,'Position',[Figure_Size(1),Figure_Size(2)+Figure_Size(4)-Original
_Size(4),Figure_Size(3),Original_Size(4)])
end
end
%设置Contact Name编辑筐Unit属性为Normalized
set(handles.Contact_Name,'units','normalized')
%获取位置
C_N_pos=get(handles.Contact_Name,'Position');
%重新设置宽度使之与窗口相匹配
set(handles.Contact_Name,'units','position',[C_N_pos(1) C_N_pos(2) 0.789 C_N
_pos(4)])
%将Unit重新设置为Characters
set(handles.Contact_Name,'units','characters')
%在屏幕上重新放置GUI
movegui(h,'onscreen')
% --------------------------------------------------------------------
function varargout = Contact_Name_Callback(h, eventdata, handles, varargin)
% 在Contact name和phone编辑筐中获取字符串
Current_Name=get(handles.Contact_Name,'string');
Current_Phone=get(handles.Contact_Phone,'string');
%如果为空则返回
if isempty(Current_Name)
return
end
%从句柄结构体中获取当前地址列表
Addresses=handles.Addresses;
%搜索姓名列表,判断是否与一个已有姓名相同
for i=1:length(Addresses)
if strcmp(Addresses(i).Name,Current_Name)
set(handles.Contact_Name,'string',Addresses(i).Name)
set(handles.Contact_Phone,'string',Addresses(i).Phone)
handles.Index=i;
guidata(h,handles)
return
end
end
%如果是一个新的姓名,请求创建一个新的条目
Answer=questdlg('Do you want to create a new entry?','Create New Entry','Ye
s','Cancel','Yes');
switch Answer
case 'Yes'
Addresses(end+1).Name=Current_Name; % Grow array by 1
Addresses(end).Phone=Current_Phone;
index=length(Addresses);
handles.Addresses=Addresses;
handles.Index=index;
guidata(h,handles)
return
case 'Cancel'
%回复为初始值
set(handles.Contact_Name,'String',Addresses(handles.Index).Name)
set(handles.Contact_Phone,'String',Addresses(handles.Index).Phone)
return
end
% --------------------------------------------------------------------
function varargout = Contact_Phone_Callback(h, eventdata, handles, varargin)
Current_Phone=get(handles.Contact_Phone,'string');
%如果为空则返回
if isempty(Current_Phone)
return
end
%从句柄结构体中获取当前地址列表
Addresses=handles.Addresses;
Answer=questdlg('Do you want to change the phone number?','Change Phone Num
ber','Yes','Cancel','Yes');
switch Answer
case 'Yes'
%如果没有相匹配的姓名则创建一个新的条目
Addresses(handles.Index).Phone=Current_Phone;
handles.Addresses=Addresses;
guidata(h,handles)
return
case 'Cancel'
%回复为初始值
set(handles.Contact_Phone,'String',Addresses(handles.Index).Phone)
return
end
% --------------------------------------------------------------------
function varargout = Prev_Next_Callback(h, eventdata, handles, varargin)
%获取被选菜单的String属性
String=get(h,'String');
%获取索引指针和地址
Addresses=handles.Addresses;
index=handles.Index;
%根据被击中的按钮修改显示结果
switch String
case 'Prev'
%索引减1
i=index-1;
%如果索引小于1,设置其为最后一个元素的索引
if i<1
i=length(Addresses);
end
case 'Next'
%索引加1
i=index+1;
%如果索引超出范围,设置其为Addresses数组的第一个元数的索引
if i>length(Addresses)
i=1;
end
end
%为被选索引获取相应的数据
Current_Name=Addresses(i).Name;
Current_Phone=Addresses(i).Phone;
set(handles.Contact_Name,'string',Current_Name)
set(handles.Contact_Phone,'string',Current_Phone)
set(handles.Serial,'string',i)
%刷新索引指针以反映新的索引指针
handles.Index=i;
guidata(h,handles)
% --------------------------------------------------------------------
function varargout = New_Callback(h, eventdata, handles, varargin)
set(handles.Contact_Name,'String','')
set(handles.Contact_Phone,'String','')
Addresses=handles.Addresses;
set(handles.Amount,'String',length(Addresses)+1)
Addresses=[Addresses(1:length(Addresses)) Addresses(length(Addresses)+1)];
Addresses(length(Addresses)+1).Name=get(handles.Contact_Name,'string');
Addresses(length(Addresses)).Name=get(handles.Contact_Phone,'string');
guidata(handles.Address_Book,handles)
% --------------------------------------------------------------------
function varargout = Open_Callback(h, eventdata, handles, varargin)
[filename,pathname]=uigetfile({'*.mat','All MAT-Files (*.mat)';'*.*','All Fi
les (*.*)'},...
'Select Address Book');
%如果选择cancel则返回
if isequal([filename,pathname],[0,0])
return
%否则构造文件全路经并检查装载该文件
else
File=fullfile(pathname,filename);
%如果MAT文件无效,不保存信息
if Check_And_Load(File,handles)
handles.LastFile=File;
guidata(h,handles)
end
end
% --------------------------------------------------------------------
function varargout = Save_Callback(h, eventdata, handles, varargin)
%获取被选菜单的Tag属性
Tag=get(h,'Tag');
%获取addresses数组
Addresses=handles.Addresses;
%根据所选项执行相应行为
switch Tag
case 'Save'
%保存到缺省的地址簿文件中去
File=handles.LastFile;
save(File,'Addresses')
case 'Save_As'
%容许用户选择要保存的目标文件名
[filename,pathname]=uiputfile({'*.mat';'*.*'},'Save as');
%如果选择cancel则返回
if isequal([filename,pathname],[0,0])
return
else
%构造全路径名并保存
File=fullfile(pathname,filename);
save(File,'Addresses')
handles.LastFile=File;
guidata(h,handles)
end
end
% --------------------------------------------------------------------
function varargout = Save_As_Callback(h, eventdata, handles, varargin)
%获取被选菜单的Tag属性
Tag=get(h,'Tag');
%获取addresses数组
Addresses=handles.Addresses;
%根据所选项执行相应行为
switch Tag
case 'Save'
%保存到缺省的地址簿文件中去
File=handles.LastFile;
save(File,'Addresses')
case 'Save_As'
%容许用户选择要保存的目标文件名
[filename,pathname]=uiputfile({'*.mat';'*.*'},'Save as');
%如果选择cancel则返回
if isequal([filename,pathname],[0,0])
return
else
%构造全路径名并保存
File=fullfile(pathname,filename);
save(File,'Addresses')
handles.LastFile=File;
guidata(h,handles)
end
end
% --------------------------------------------------------------------
function varargout = Revise_Callback(h, eventdata, handles, varargin)
pos_size1=get(handles.Address_Book,'Position');
dlg_pos1=[pos_size1(1)+pos_size1(3)/8 pos_size1(2)+pos_size1(4)/8];
[answer,string]=ReviseInquire(dlg_pos1);
switch answer
case 'Confirm'
pos_size2=get(handles.Address_Book,'Position');
dlg_pos2=[pos_size2(1)+pos_size2(3)/5 pos_size2(2)+pos_size2(4)/8];
[NameRevise,PhoneRevise]=revisecon(dlg_pos2);
i=handles.Index;
i=str2double(string);
Addresses=handles.Addresses;
Addresses(i).Name=NameRevise;
Addresses(i).Phone=PhoneRevise;
Addresses=[Addresses(1:(i-1)) Addresses(i) Addresses((i+1):length(Addres
ses))]
handles.Addresses=Addresses;
guidata(handles.Address_Book,handles)
set(handles.Contact_Name,'string',Addresses(i).Name)
set(handles.Contact_Phone,'string',Addresses(i).Phone)
File=handles.LastFile;
save(File,'Addresses')
case 'Quit'
end
% --------------------------------------------------------------------
function varargout = Remove_Callback(h, eventdata, handles, varargin)
pos_size3=get(handles.Address_Book,'position');%确定当前GUI的位置
user_response3=removewindow([pos_size3(1)+pos_size3(3)/8 pos_size3(
2)+pos_size3(4)/8]);
switch user_response3
case 'Yes'
index=get(handles.Serial,'String');
i=str2double(index);
Addresses=handles.Addresses;
Addresses=[Addresses(1:(i-1)) Addresses((i+1):length(Addresses)
)]
handles.Addresses=Addresses;
guidata(handles.Address_Book,handles)
set(handles.Contact_Name,'string',Addresses(i).Name)
set(handles.Contact_Phone,'string',Addresses(i).Phone)
File=handles.LastFile;
save(File,'Addresses')
case {'No','Cancel'}
end
────────────────────────────────────────
zjliu (秋天的萝卜) 于 2003年06月12日21:38:56 星期四 说道:
真够长的
────────────────────────────────────────
simples (simple) 于 2003年06月12日21:39:12 星期四 说道:
第二个removewindow.m文件:
function answer = removewindow(varargin)
% REMOVEWINDOW Application M-file for removewindow.fig
% FIG = REMOVEWINDOW launch removewindow GUI.
% REMOVEWINDOW('callback_name', ...) invoke the named callback.
% Last Modified by GUIDE v2.0 24-May-2003 19:44:44
error(nargchk(0,4,nargin)) %函数接受0、1、4各参数
if nargin==0|isnumeric(varargin{1})
fig=openfig(mfilename,'reuse');
set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));
handles=guihandles(fig);
guidata(fig,handles);
%指定对话框的位置
if nargin==1
pos_size=get(fig,'Position');
pos=varargin{1};
if length(pos)~=2
error('Input argument must be a 2-element vector')
end
new_pos=[pos(1) pos(2) pos_size(3) pos_size(4)];
set(fig,'Position',new_pos,'Visible','on')
figure(fig)
end
%等待用户响应
uiwait(fig);
if ~ishandle(fig)
answer='Cancel';
else
handles=guidata(fig);
answer=handles.answer;
delete(fig);
end
%执行回调函数
elseif ischar(varargin{1}) %调用指定的子函数或回调函数
try
[varargout{1:nargout}]=feval(varargin{:});
catch
disp(lasterr);
end
end
%| ABOUT CALLBACKS:
%| GUIDE automatically appends subfunction prototypes to this file, and
%| sets objects' callback properties to call them through the FEVAL
%| switchyard above. This comment describes that mechanism.
%|
%| Each callback subfunction declaration has the following form:
%| <SUBFUNCTION_NAME>(H, EVENTDATA, HANDLES, VARARGIN)
%|
%| The subfunction name is composed using the object's Tag and the
%| callback type separated by '_', e.g. 'slider2_Callback',
%| 'figure1_CloseRequestFcn', 'axis1_ButtondownFcn'.
%|
%| H is the callback object's handle (obtained using GCBO).
%|
%| EVENTDATA is empty, but reserved for future use.
%|
%| HANDLES is a structure containing handles of components in GUI using
%| tags as fieldnames, e.g. handles.figure1, handles.slider2. This
%| structure is created at GUI startup using GUIHANDLES and stored in
%| the figure's application data using GUIDATA. A copy of the structure
%| is passed to each callback. You can store additional information in
%| this structure at GUI startup, and you can change the structure
%| during callbacks. Call guidata(h, handles) after changing your
%| copy to replace the stored original so that subsequent callbacks see
%| the updates. Type "help guihandles" and "help guidata" for more
%| information.
%|
%| VARARGIN contains any extra arguments you have passed to the
%| callback. Specify the extra arguments by editing the callback
%| property in the inspector. By default, GUIDE sets the property to:
%| <MFILENAME>('<SUBFUNCTION_NAME>', gcbo, [], guidata(gcbo))
%| Add any extra arguments after the last argument, before the final
%| closing parenthesis.
% --------------------------------------------------------------------
function varargout = YesButton_Callback(h, eventdata, handles, varargin)
handles.answer='Yes';
guidata(h,handles);
uiresume(handles.removefigure);
% --------------------------------------------------------------------
function varargout = NoButton_Callback(h, eventdata, handles, varargin)
handles.answer='No';
guidata(h,handles);
uiresume(handles.removefigure);
% --------------------------------------------------------------------
function varargout = removefigure_CloseRequestFcn(h, eventdata, handles, var
argin)
pushbutton1_Callback(h,eventdata,handles)
────────────────────────────────────────
simples (simple) 于 2003年06月12日21:39:32 星期四 说道:
haha!
是呀
────────────────────────────────────────
simples (simple) 于 2003年06月12日21:40:46 星期四 说道:
the thrid: reviseinquire.m
function [answer,string]= ReviseInquire(varargin)
% REVISEINQUIRE Application M-file for ReviseInquire.fig
% FIG = REVISEINQUIRE launch ReviseInquire GUI.
% REVISEINQUIRE('callback_name', ...) invoke the named callback.
% Last Modified by GUIDE v2.0 23-May-2003 09:13:44
error(nargchk(0,4,nargin)) %函数接受0、1、4各参数
if nargin==0|isnumeric(varargin{1})
fig=openfig(mfilename,'reuse');
set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));
handles=guihandles(fig);
guidata(fig,handles);
%指定对话框的位置
if nargin==1
pos_size1=get(fig,'Position');
pos1=varargin{1};
if length(pos1)~=2
error('Input argument must be a 2-element vector')
end
new_pos1=[pos1(1) pos1(2) pos_size1(3) pos_size1(4)];
set(fig,'Position',new_pos1,'Visible','on')
% Wait for callbacks to run and window to be dismissed
figure(fig)
end
%等待用户响应
uiwait(fig);
if ~ishandle(fig)
answer='Quit';
else
handles=guidata(fig);
string=get(handles.Serial_Num,'String');
answer=handles.answer;
delete(fig);
end
elseif ischar(varargin{1}) %调用指定的子函数或回调函数
try
[varargout{1:nargout}]=feval(varargin{:});
catch
disp(lasterr);
end
end
%| ABOUT CALLBACKS:
%| GUIDE automatically appends subfunction prototypes to this file, and
%| sets objects' callback properties to call them through the FEVAL
%| switchyard above. This comment describes that mechanism.
%|
%| Each callback subfunction declaration has the following form:
%| <SUBFUNCTION_NAME>(H, EVENTDATA, HANDLES, VARARGIN)
%|
%| The subfunction name is composed using the object's Tag and the
%| callback type separated by '_', e.g. 'slider2_Callback',
%| 'figure1_CloseRequestFcn', 'axis1_ButtondownFcn'.
%|
%| H is the callback object's handle (obtained using GCBO).
%|
%| EVENTDATA is empty, but reserved for future use.
%|
%| HANDLES is a structure containing handles of components in GUI using
%| tags as fieldnames, e.g. handles.figure1, handles.slider2. This
%| structure is created at GUI startup using GUIHANDLES and stored in
%| the figure's application data using GUIDATA. A copy of the structure
%| is passed to each callback. You can store additional information in
%| this structure at GUI startup, and you can change the structure
%| during callbacks. Call guidata(h, handles) after changing your
%| copy to replace the stored original so that subsequent callbacks see
%| the updates. Type "help guihandles" and "help guidata" for more
%| information.
%|
%| VARARGIN contains any extra arguments you have passed to the
%| callback. Specify the extra arguments by editing the callback
%| property in the inspector. By default, GUIDE sets the property to:
%| <MFILENAME>('<SUBFUNCTION_NAME>', gcbo, [], guidata(gcbo))
%| Add any extra arguments after the last argument, before the final
%| closing parenthesis.
% --------------------------------------------------------------------
function varargout = Confirm_Callback(h, eventdata, handles, varargin)
handles.answer='Confirm';
guidata(h,handles);
uiresume(handles.ReviseInquire);
% --------------------------------------------------------------------
function varargout = Quit_Callback(h, eventdata, handles, varargin)
handles.answer='Quit';
guidata(h,handles);
uiresume(handles.ReviseInquire);
────────────────────────────────────────
zjliu (秋天的萝卜) 于 2003年06月12日21:40:54 星期四 说道:
现在我忙,没时间试验,有没有闲人来瞧瞧阿
────────────────────────────────────────
simples (simple) 于 2003年06月12日21:41:36 星期四 说道:
revisecon.m
function [NameRevise,PhoneRevise]= revisecon(varargin)
% REVISE Application M-file for Revise.fig
% FIG = REVISE launch Revise GUI.
% REVISE('callback_name', ...) invoke the named callback.
% Last Modified by GUIDE v2.0 23-May-2003 08:38:18
error(nargchk(0,4,nargin)) %函数接受0、1、4各参数
if nargin==0|isnumeric(varargin{1})
fig=openfig(mfilename,'reuse');
set(fig,'Color',get(0,'defaultUicontrolBackgroundColor'));
handles=guihandles(fig);
guidata(fig,handles);
%指定对话框的位置
if nargin==2
pos_size2=get(fig,'Position');
pos2=varargin{1};
if length(pos2)~=2
error('Input argument must be a 2-element vector')
end
new_pos2=[pos2(1) pos2(2) pos_size2(3) pos_size2(4)];
set(fig,'Position',new_pos2,'Visible','on')
% Wait for callbacks to run and window to be dismissed
figure(fig)
end
%等待用户响应
uiwait(fig);
if ~ishandle(fig)
return
else
handles=guidata(fig);
NameRevise=get(handles.Name,'String');
PhoneRevise=get(handles.Phone,'String');
delete(fig);
end
elseif ischar(varargin{1}) %调用指定的子函数或回调函数
try
[varargout{1:nargout}]=feval(varargin{:});
catch
disp(lasterr);
end
end
%| ABOUT CALLBACKS:
%| GUIDE automatically appends subfunction prototypes to this file, and
%| sets objects' callback properties to call them through the FEVAL
%| switchyard above. This comment describes that mechanism.
%|
%| Each callback subfunction declaration has the following form:
%| <SUBFUNCTION_NAME>(H, EVENTDATA, HANDLES, VARARGIN)
%|
%| The subfunction name is composed using the object's Tag and the
%| callback type separated by '_', e.g. 'slider2_Callback',
%| 'figure1_CloseRequestFcn', 'axis1_ButtondownFcn'.
%|
%| H is the callback object's handle (obtained using GCBO).
%|
%| EVENTDATA is empty, but reserved for future use.
%|
%| HANDLES is a structure containing handles of components in GUI using
%| tags as fieldnames, e.g. handles.figure1, handles.slider2. This
%| structure is created at GUI startup using GUIHANDLES and stored in
%| the figure's application data using GUIDATA. A copy of the structure
%| is passed to each callback. You can store additional information in
%| this structure at GUI startup, and you can change the structure
%| during callbacks. Call guidata(h, handles) after changing your
%| copy to replace the stored original so that subsequent callbacks see
%| the updates. Type "help guihandles" and "help guidata" for more
%| information.
%|
%| VARARGIN contains any extra arguments you have passed to the
%| callback. Specify the extra arguments by editing the callback
%| property in the inspector. By default, GUIDE sets the property to:
%| <MFILENAME>('<SUBFUNCTION_NAME>', gcbo, [], guidata(gcbo))
%| Add any extra arguments after the last argument, before the final
%| closing parenthesis.
% --------------------------------------------------------------------
function varargout = Confirm_Revise_Callback(h, eventdata, handles, varargin)
uiresume(handles.revisecon);
────────────────────────────────────────
simples (simple) 于 2003年06月12日21:43:38 星期四 说道:
不一定能执行呢,因为里面用到了.mat文件,我没给出来,而且它们还应改和.fig一起
调用吧,单独的执行.m好像无法打开界面。
.......
────────────────────────────────────────
simples (simple) 于 2003年06月12日21:54:09 星期四 说道:
是否用uicontrol这个函数能绘出界面?我在网上搜寻到了一些挺有意思的.m文件,其中
我看到了由于一个中有这样的程序:
在workspace里执行,它能产生一个界面:
col0=20;
hfig=figure('Units','normalized','Position',[0.1 0.2 0.8 0.6 ],'Name','Fra
ctals', ...
'numbertitle','off','MenuBar','figure','WindowStyle','normal','Color',[0
.8 0.8 0.8 ],'Resize','on' ...
);
hlb1=uicontrol('Units','normalized','Position',[0.05 0.6 0.3 0.3 ], ...
'Style','listbox','BackgroundColor',[1 1 1 ],'ForegroundColor',[0 0 0 ],
...
'String','Mandelbrot sets|Julia sets|Newton''s method sets|z^z+c sets|3D
fractals|Decorations', ...
'FontSize',10,'Max',1,'Min',0,'ListboxTop',2,'Value',1,'callback','fract
als(''lb1'');');
hlb2=uicontrol('Units','normalized','Position',[0.05 0.1 0.3 0.5 ], ...
'Style','listbox','BackgroundColor',[1 1 1 ],'ForegroundColor',[0 0 0 ],
...
'FontSize',10,'Max',1,'Min',0,'ListboxTop',1,'Value',1,'callback','fract
als(''lb2'');');
hlb3=uicontrol('Units','normalized','Position',[0.37 0.1 0.03 0.8 ], ...
'Style','slider','BackgroundColor',[1 1 1 ],'ForegroundColor',[0 0 0 ],
...
'FontSize',5,'Max',50,'Min',5,'ListboxTop',1,'Value',col0,'callback','fr
actals(''lb3'');');
uicontrol('Units','normalized','Position',[0.31 0.92 0.15 0.05 ], ...
'Style','text','BackgroundColor',[1 1 1 ],'ForegroundColor',[0 0 0 ], ..
.
'FontSize',10,'String','Max iterations');
uicontrol('Units','normalized','Position',[0.31 0.03 0.15 0.05 ], ...
'Style','text','BackgroundColor',[1 1 1 ],'ForegroundColor',[0 0 0 ], ..
.
'FontSize',10,'String','Min iterations');
hplot=axes('Units','normalized','Position',[0.45 0.1 0.5 0.8 ],'NextPlot',
'replace', ...
'Color',[0.75 0.75 0.75 ],'GridLineStyle',':','TickDir','in','TickLength
',[0.01 0.025 ] ...
);
────────────────────────────────────────
zjliu (秋天的萝卜) 于 2003年06月12日21:57:27 星期四 说道:
你也贴了这么多,哪里有问题,你明确一下,
要不然别人一看到so long的程序肯定要吓跑,
同时也节省一下大家的时间
────────────────────────────────────────
simples (simple) 于 2003年06月13日21:28:42 星期五 说道:
如题啊!
我要看.fig文件的.m文件。如何办?
────────────────────────────────────────
zjliu (秋天的萝卜) 于 2003年06月13日21:37:24 星期五 说道:
ok, 那你再把你的图贴一下
────────────────────────────────────────
simples (simple) 于 2003年06月13日21:56:41 星期五 说道:
不好意思了~~~~~
我不会,发到你信箱把,如果可以的话
────────────────────────────────────────
zjliu (秋天的萝卜) 于 2003年06月13日22:15:22 星期五 说道:
可以
────────────────────────────────────────
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:203.887毫秒