w5_ed.m

来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 136 行

M
136
字号
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	w5_edit.m
%
%	jmw
%	6/20/94
%
%       User-Specified Maps:  Edit Window
%	This sets up the buttons for the user-modified mapping GUI
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% this program called from w5_edit_select, which in turn is
% called from w5_edit_pre_edit, which is the callback for 
% the "Edit" button in window 5
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clf;
clear w5_edit_user_h

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% get TARGETVALUE 
[t_m, t_n] = size(target);

if (t_m == 2)
	TARGETVALUE = 1;
elseif (t_m == 3)
	TARGETVALUE = 2;
elseif (t_m == 6)
	TARGETVALUE = 3;
elseif (t_m == 11)
	TARGETVALUE = 4;
end;

OLDTARGETVALUE = TARGETVALUE;
OLDSMOOTHVALUE = SMOOTHVALUE;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% establish reference point for all buttons

w5_edit_L1 = 20;
w5_edit_H1 = w5_edit_ht - 250;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% divide in half

subplot(211);
	axis([0 100 0 1]);
	axis off;
subplot(212);
	axis([0 100 0 1]);
	axis off;

% make title and button labels

subplot(212);

w5_edit_pos(i,:) = [ 0  0.95];
s=sprintf('User %d Map Editing', MAPINDEX);
text('Position',w5_edit_pos(i,:),'String', s ,'color',TEXT_COLOR);
line([0 100],[1 1],'color',TEXT_COLOR);

text(0, 0.24, '# Targets','color',TEXT_COLOR);
text(29, 0.24, 'Smoothing','color',TEXT_COLOR);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make ok button

w5_edit_ok_h=uicontrol('Position',[w5_edit_L1+40 w5_edit_H1-70 70 30],...
	'String','OK','Callback','w5_ed_ok');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make cancel button

w5_edit_cancel_h=uicontrol('Position',[w5_edit_L1+240 w5_edit_H1-70 70 30],...
	'String','Cancel','Callback','w5_ed_ca',...
	'Visible','off');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make update button

w5_edit_update_h=uicontrol('Position',[w5_edit_L1+140 w5_edit_H1-70 70 30],...
	'String','Update','Callback', 'w5_ed_up',...
	'Visible','off');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make target ADJUST pushbutton

w5_edit_adjust_h=uicontrol('Position',[w5_edit_L1+240 w5_edit_H1-160 70 30],...
	'String','Adjust','Style','pushbutton',...
	'Callback','w5_ed_ad');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make number of targets popupmenu

w5_edit_target_h=uicontrol('Position',[w5_edit_L1+40 w5_edit_H1-160 60 30],...
	'String','2 | 3 | 6 | 11','Style','popupmenu','Value',TARGETVALUE,...
	'Callback','w5_ed_ta');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make target smoothing popupmenu

TARGET_SMOOTH = 1;	% flag to indicate smoothing needs to be redone

w5_edit_smooth_h=uicontrol('Position',[w5_edit_L1+140 w5_edit_H1-160 70 30],...
	'String',...
	'None | Linear | Poly 2 | Poly 3 | Poly 4 | Poly 5',...
	'Style','popupmenu','Value',SMOOTHVALUE,...
	'Callback','w5_ed_sm');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% set variable to indicate first time window is displayed

FRESHOPENW5 = 1;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% call smooth and display

w5_ed_sm

%return;


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?