getsig.m

来自「信号实验常用的simulink模型和mfile,可直接在matlan下运行。」· M 代码 · 共 36 行

M
36
字号
global fun_str;
h=findobj('tag','getlxzq');
if ~isempty(h),
	figure(h);
else
	b1call=['temp=get(gcf,''userdata'');',...
		't=temp(1);h=temp(2);',...
		'fun_str=get(t,''string'');',...
		'close(h);clear temp t h b1 b2 l b1call b2call;',...
		'lxzq(''redraw'');'];
	b2call=['temp=get(gcf,''userdata'');',...
		'h=temp(2);',...
		'fun_str=[];',...
		'close(h);clear temp t h b1 b2 l b1call b2call;'];
	h=figure('menubar','none','NumberTitle','off',...
		'units','pixel','position',[200 200 250 100],...
		'color',[.7 .7 .7],'name','输入框',...
		'resize','off','tag','getlxzq');
	l=uicontrol(h,'style','text','units','normalized',...
		'backgroundcolor',[.7 .7 .7],'HorizontalAlignment','left',...
		'position',[0.05 0.65 0.9 0.25],'string','请输入信号波形表达式:');
	t=uicontrol(h,'style','edit','units','normalized',...
		'backgroundcolor',[1 1 1],'HorizontalAlignment','left',...
		'position',[0.05 0.40 0.9 0.25],'string','sin(2*pi*30*t).*sin(2*pi*3*t)',...
		'max',1,'min',0);
	b1=uicontrol(h,'style','pushbutton','units','normalized',...
		'HorizontalAlignment','left',...
		'position',[0.1 0.05 0.35 0.3],'string','确  定',...
		'callback',b1call);
	b2=uicontrol(h,'style','pushbutton','units','normalized',...
		'HorizontalAlignment','left',...
		'position',[0.55 0.05 0.35 0.3],'string','取  消',...
		'callback',b2call);
	set(h,'userdata',[t,h]);
end

⌨️ 快捷键说明

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