?? dspmain.asv
字號:
% Run examples
%----------------------------------------------------------------
for i = 1 : num_chap
run_1(i) = uimenu (hm_1,'Label',sprintf('Chapter %g',i));
end
[m,n] = size (fdsp_exam);
num_exam = zeros(11,1); % number of examples
for i = 1 : m
cback = sprintf (...
['set(gcf,''Visible'',''off''), save f_dsp, %s, clear, load f_dsp, delete(''f_dsp.mat''), '...
'clc, set(gcf,''Visible'',''on'')'], fdsp_exam(i,1:8));
label = deblank(fdsp_exam(i,10:n));
% Chapters
for j = 1 : num_chap
s = sprintf('exam%g',j);
if (strcmp(fdsp_exam(i,1:5),s)) & (fdsp_exam(i,6) ~= '0')
num_exam(j) = num_exam(j) + 1;
run_11(num_exam(j)) = uimenu (run_1(j),'Label',label,...
'Callback',cback);
end
end
end
%----------------------------------------------------------------
% Run figures
%----------------------------------------------------------------
for i = 1 : num_chap
run2(i) = uimenu (hm_2,'Label',sprintf('Chapter %g',i));
end
[m,n] = size (fdsp_fig);
num_fig = zeros(11,1); % number of figures
for i = 1 : m
cback = sprintf (...
['set(gcf,''Visible'',''off''), save f_dsp, %s, clear, load f_dsp, delete (''f_dsp.mat''), '...
'clc, set(gcf,''Visible'',''on'')'], fdsp_fig(i,1:8));
label = deblank(fdsp_fig(i,10:n));
% Chapters
for j = 1 : num_chap
s = sprintf('fig%g',j);
if (strcmp(fdsp_fig(i,1:4),s)) & (fdsp_fig(i,5) ~= '0')
num_fig(j) = num_fig(j) + 1;
run21(num_fig(j)) = uimenu (run2(j),'Label',label,...
'Callback',cback);
end
end
end
%----------------------------------------------------------------
% Run Problems
%----------------------------------------------------------------
olddir = pwd;
fdspdir = [matlabroot filesep 'toolbox' filesep 'fdsp' filesep 'fdsp'];
cd (fdspdir)
try getpref('FDSP_preferences','reader_file');
reader_path = getpref ('FDSP_preferences','reader_path');
reader_file = getpref ('FDSP_preferences','reader_file');
for i = 1 : num_chap
run3(i) = uimenu (hm_3,'Label',sprintf('Chapter %g',i));
end
[m,n] = size (fdsp_prob);
num_prob = zeros(10,1); % number of problems
for i = 1 : m
label = deblank(fdsp_prob(i,10:n));
pdf_file = which([deblank(fdsp_prob(i,1:8)) '.pdf']);
cback = [...
'fprintf (''Initializing Adobe Acrobat Reader...\n''); '...
'work_dir = pwd; '...
sprintf('cd(''%s''), ',reader_path)...
'set(gcf,''Visible'',''off''), '...
sprintf('system (''%s %s''), ',reader_file,pdf_file)...
'clc, set(gcf,''Visible'',''on''), '...
'cd(work_dir);'
];
% Chapters
for j = 1 : num_chap
s = sprintf('prob%g',j);
if (strcmp(fdsp_prob(i,1:5),s)) & (fdsp_prob(i,6) ~= '0')
num_prob(j) = num_prob(j) + 1;
run31(num_prob(j)) = uimenu (run3(j),'Label',label,...
'Callback',cback);
end
end
end
catch
cback = ['helpwin (''f_regreader'')'];
hm_30 = uimenu (hm_3,'Label','Help','Callback',cback);
end
%if instructor
% olddir = pwd;
% fdspdir = [matlabroot filesep 'toolbox' filesep 'fdsp' filesep 'fdsp'];
% cd (fdspdir)
% try
% reader_path = getpref ('FDSP_preferences','reader_path');
% reader_file = getpref ('FDSP_preferences','reader_file');
% hm32 = uimenu (hm_3,'Label','Select entire chapter','Separator','on');
% cback_solvechap = [
% 'problist = problems(prob,2); '...
% '[s,v] = listdlg(''PromptString'','...
% '''Select chapter number.'','...
% '''ListSize'',[150 300],'...
% '''SelectionMode'',''single'','...
% '''ListString'',nums(1:9)); '...
% 'pdf_file = sprintf(''problems_%d.pdf'',s); '...
% 'pdf_file = which(pdf_file); '...
% 'fprintf (''Initializing Adobe Acrobat Reader...\n''); '...
% 'work_dir = pwd; '...
% sprintf('cd(''%s''); ',reader_path)...
% 'set(gcf,''Visible'',''off''); '...
% 'eval( [''system('' quote reader_file space pdf_file quote '')''] ); '...
% 'set(gcf,''Visible'',''on''); '...
% 'clc, cd(work_dir);'
% ];
% set (hm32,'Callback',cback_solvechap)
% catch
% cback = ['helpwin (''f_regreader'')'];
% hm_30 = uimenu (hm_3,'Label','Help','Callback',cback);
% end
%end
% Reader updates
cback = ['if f_regreader, '...
' close, f_dsp, '...
'end'];
hm_33 = uimenu (hm_3,'Separator','on','Label','Register Acrobat Reader with FDSP','Callback',cback);
cback = ['web http://www.adobe.com/products/acrobat/readstep2.html;'];
hm_34 = uimenu (hm_3,'Label','Download Adobe Acrobat Reader','Callback',cback);
cd (olddir)
%----------------------------------------------------------------
% Help Menu
%----------------------------------------------------------------
% User tips
cback = ['set(gcf,''Selected'',''off''); helpwin f_tipsfdsp; set(gcf,''Selected'',''on'')'];
hm_43 = uimenu (hm_4,'Label','User Tips','Separator','off','Callback',cback);
% Function Help
hm_42 = uimenu (hm_4,'Label','Toolbox functions');
[m,n] = size(fdsp_help);
num_fun = zeros(m,1); % number of functions
for i = 1 : m
nhelp(i) = uimenu (hm_42,'Label',sprintf('%s',fdsp_help(i,1:n)));
end
[p,q] = size(fdsp_fun);
for i = 1 : p
cback = sprintf (...
'set(gcf,''Selected'',''off''); helpwin %s; set(gcf,''Selected'',''on'')',...
fdsp_fun(i,4:16));
label = [fdsp_fun(i,4:16) fdsp_fun(i,19:q)];
% Chapters
for j = 1 : num_chap+1
s = sprintf('%g',j-1);
if strcmp(fdsp_fun(i,1),s) & ~strcmp(fdsp_fun(i,2),'0')
num_fun(j) = num_fun(j) + 1;
nhelp11(num_fun(j)) = uimenu (nhelp(j),'Label',label,...
'Callback',cback);
if fdsp_fun(i,15) == '.'
set (nhelp11(num_fun(j)),'Separator','on')
end
end
end
end
% GUI Modules Help
hm_41 = uimenu (hm_4,'Label','Toolbox GUI modules');
for i = 1 : num_guis
gmod = guis(i,:);
cback = sprintf (...
'set(gcf,''Selected'',''off''); helpwin %s; set(gcf,''Selected'',''on'')',...
gmod);
nhelp(i) = uimenu (hm_41,'Label',gmod,'Callback',cback);
end
if instructor
cback = sprintf (...
'set(gcf,''Selected'',''off''); helpwin %s; set(gcf,''Selected'',''on'')',...
'g_homework');
nhelp(num_guis+1) = uimenu (hm_41,'Label','g_homework','Separator','on','Callback',cback);
end
% Examples help
hm_46 = uimenu (hm_4,'Label','Toolbox examples');
for i = 1 : num_chap
help_1(i) = uimenu (hm_46,'Label',sprintf('Chapter %g',i));
end
[m,n] = size (fdsp_exam);
num_exam = zeros(11,1); % number of examples
for i = 1 : m
cback = sprintf (...
['set(gcf,''Selected'',''off''), helpwin %s, '...
'set(gcf,''Selected'',''on'')'], fdsp_exam(i,1:8));
label = deblank(fdsp_exam(i,10:n));
% Chapters
for j = 1 : num_chap
s = sprintf('exam%g',j);
if (strcmp(fdsp_exam(i,1:5),s)) & (fdsp_exam(i,6) ~= '0')
num_exam(j) = num_exam(j) + 1;
help_11(num_exam(j)) = uimenu (help_1(j),'Label',label,...
'Callback',cback);
end
end
end
% Figures Help
hm_45 = uimenu (hm_4,'Label','Toolbox figures');
for i = 1 : num_chap
run2(i) = uimenu (hm_45,'Label',sprintf('Chapter %g',i));
end
[m,n] = size (fdsp_fig);
num_fig = zeros(11,1); % number of figures
for i = 1 : m
cback = sprintf (...
['set(gcf,''Selected'',''off''), helpwin %s, '...
'set(gcf,''Selected'',''on'')'], fdsp_fig(i,1:8));
label = deblank(fdsp_fig(i,10:n));
% Chapters
for j = 1 : num_chap
s = sprintf('fig%g',j);
if (strcmp(fdsp_fig(i,1:4),s)) & (fdsp_fig(i,5) ~= '0')
num_fig(j) = num_fig(j) + 1;
run21(num_fig(j)) = uimenu (run2(j),'Label',label,...
'Callback',cback);
end
end
end
% General information
cback = ['set(gcf,''Selected'',''off''); helpwin f_infofdsp; set(gcf,''Selected'',''on'')'];
hm_44 = uimenu (hm_4,'Label','General Information','Separator','on','Callback',cback);
% About fdsp
cback = ['set(gcf,''Selected'',''off''); helpwin f_dsp; set(gcf,''Selected'',''on'')'];
hm_45 = uimenu (hm_4,'Label','About f_dsp','Separator','off','Callback',cback);
% Web
cback = 'helpwin f_updates';
hm_61 = uimenu (hm_6,'Label','FDSP Updates','Callback',cback);
cback = ['web http://www.brookscole.com/'];
hm_65 = uimenu (hm_6,'Label','Brooks/Cole Publishing','Callback',cback);
cback = ['web http://www.matlab.com/'];
hm_66 = uimenu (hm_6,'Label','The MathWorks','Callback',cback);
hm_64 = uimenu (hm_6,'Label','Authors','Separator','off');
cback = ['web http://www.clarkson.edu/~schillin/;'];
hm_641 = uimenu (hm_64,'Label','R. J. Schilling','Callback',cback);
cback = ['web http://www.clarkson.edu/chemeng/faculty/harris.html;'];
hm_642 = uimenu (hm_64,'Label','S. L. Harris','Callback',cback);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -