⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 versioni.m

📁 包内有产生线性调频波、非线性调频波的源码
💻 M
字号:
echo off all;

h0 = figure('Color',[0.8 0.8 0.8], ...
	'PaperPosition',[20 180 500 400], ...
	'PaperUnits','points', ...
	'Position',[1 31 1023 700], ...
   'ToolBar','none');

%-----------------------------------------1.文本框----------------------------------------
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',18, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[20 365 140 75], ...
	'String','', ...
	'Style','text', ...
    'Tag','us');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',18, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[170 365 580 75], ...
	'String','', ...
	'Style','text', ...
    'Tag','us');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.8 0.8 0.8], ...
	'FontName','黑体', ...
	'FontSize',26, ...
	'FontWeight','bold', ...
	'ListboxTop',0, ...
	'Position',[15 480 730 35], ...
	'String','雷达波形数据产生软件(测试台版本)', ...
	'Style','text', ...
	'Tag','标题文本框');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.8 0.8 0.8], ...
	'FontName','楷体_GB2312', ...
	'FontSize',16, ...
	'FontWeight','bold', ...
	'ListboxTop',0, ...
	'Position',[210 460 340 20], ...
	'String','电子科技大学电子工程学院706教研室', ...
	'Style','text', ...
   'Tag','副标题文本框');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',18, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[20 410 140 26], ...
	'String','波形种类选择', ...
	'Style','text', ...
   'Tag','波形种类');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',18, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[170 410 140 26], ...
	'String','波形参数输入', ...
	'Style','text', ...
   'Tag','波形参数');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',18, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[175 370 50 26], ...
	'String','脉宽', ...
	'Style','text', ...
   'Tag','脉冲宽度');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',16, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[250 367 78 26], ...
	'String','us', ...
	'Style','text', ...
   'Tag','us');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',18, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[300 370 50 26], ...
	'String','带宽', ...
	'Style','text', ...
   'Tag','带宽');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',16, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[385 367 80 26], ...
	'String','MHz', ...
	'Style','text', ...
   'Tag','MHz');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',18, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[450 370 50 26], ...
	'String','中频', ...
	'Style','text', ...
   'Tag','中频');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',16, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[535 367 78 26], ...
	'String','MHz', ...
	'Style','text', ...
   'Tag','MHz');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',18, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[600 370 50 26], ...
	'String','时钟', ...
	'Style','text', ...
   'Tag','时钟');
h1 = uicontrol('Units','points', ...
	'BackgroundColor',[0.7 0.7 0.7], ...
	'FontName','楷体_GB2312', ...
	'FontSize',16, ...
	'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[700 367 50 26], ...
	'String','MHz', ...
	'Style','text', ...
   'Tag','MHz');

SAVEtext = uicontrol('Units','points', ...
   'BackgroundColor',[1 1 1], ...
   'FontName','Courier New', ...
	'FontSize',14, ...
	'FontWeight','bold', ...
	'ListboxTop',0, ...
	'Position',[145 330 545 26], ...
	'Style','text', ...
	'Tag','保存文本框');
   
   

%------------------------------------------------2.文本编辑框-------------------------------------------------
TW=[];BW=[];IF0=[];FS=[];

T_EDIT = uicontrol(	'Units','points', ...
	'BackgroundColor',[1 1 1], ...
	'Callback','TW=str2num(char(get(gcbo,''String'')));set(BUTsave,''Enable'',''off'');', ...
	'FontSize',14, ...
	'ListboxTop',0, ...
	'Position',[225 372 50 22], ...
   'Style','edit', ...
   'visible','on',...
   'Tag','脉宽编辑框');
B_EDIT = uicontrol(	'Units','points', ...
	'BackgroundColor',[1 1 1], ...
	'Callback','BW=str2num(char(get(gcbo,''String'')));set(BUTsave,''Enable'',''off'');', ...
	'FontSize',14, ...
	'ListboxTop',0, ...
	'Position',[350 372 50 22], ...
   'Style','edit', ...
   'visible','on',...
   'Tag','带宽编辑框');
IF_EDIT= uicontrol(	'Units','points', ...
	'BackgroundColor',[1 1 1], ...
	'Callback','IF0=str2num(char(get(gcbo,''String'')));set(BUTsave,''Enable'',''off'');', ...
	'FontSize',14, ...
	'ListboxTop',0, ...
	'Position',[500 372 50 22], ...
   'Style','edit', ...
   'visible','on',...
   'Tag','中频编辑框');
FS_EDIT = uicontrol(	'Units','points', ...
	'BackgroundColor',[1 1 1], ...
	'Callback','FS=str2num(char(get(gcbo,''String'')));set(BUTsave,''Enable'',''off'');', ...
	'FontSize',14, ...
	'ListboxTop',0, ...
	'Position',[650 372 50 22], ...
   'Style','edit', ...
   'visible','on',...
   'Tag','时钟编辑框');
   
%---------------------------------------------------3.列表框------------------------------------------------
bitstr={'线性调频','非线性调频','单频脉冲','锯齿脉冲'};
waveform=1;

wavelist = uicontrol('Units','points', ...
   'BackgroundColor',[0.7 0.7 0.7], ...
   'Callback','waveform=get(gcbo,''Value'');set(BUTsave,''Enable'',''off'');genfunc(waveform,B_EDIT);',...
   'FontName','楷体_GB2312', ...
   'FontSize',18, ...
   'FontWeight','demi', ...
	'ListboxTop',0, ...
	'Position',[30 375 120 25], ...
   'String',bitstr, ...
   'Style','popupmenu', ...
	'Tag','波形种类列表框', ...
	'Value',1);

%------------------------------------------------4.按钮------------------------------------------
str=['保存文件夹为'];
filename=[];

BUTpara = uicontrol(	'Units','points', ...
   'BackgroundColor',[0.7 0.7 0.7], ...
   'Callback','wave=datagen(waveform,TW,BW,IF0,FS,BUTsave,show1,show2);', ...
   'FontName','楷体_GB2312', ...
   'FontSize',20, ...
   'FontWeight','demi', ...
   'ListboxTop',0, ...
   'Position',[485 410 100 26], ...
   'String','参数确定', ...
   'Tag','参数确定按钮');
BUTfile = uicontrol(	'Units','points', ...
   'BackgroundColor',[0.925490196078431 0.913725490196078 0.847058823529412], ...
   'Callback','filename=filegen(str,SAVEtext);',...
   'FontName','楷体_GB2312', ...
   'FontSize',20, ...
   'FontWeight','demi', ...
   'ListboxTop',0, ...
   'Position',[20 330 115 26], ...
   'String','输出波形名', ...
   'Tag','保存路径按钮');
BUTsave = uicontrol(	'Units','points', ...
   'BackgroundColor',[0.925490196078431 0.913725490196078 0.847058823529412], ...
   'Callback','savegen(filename,wave);',...
   'FontName','楷体_GB2312', ...
   'FontSize',20, ...
   'FontWeight','demi', ...
   'ListboxTop',0, ...
   'Position',[700 330 50 26], ...
   'String','保存', ...
   'Enable','off',...
   'Tag','保存文件按钮');
BUTrom = uicontrol(	'Units','points', ...
   'BackgroundColor',[0.7 0.7 0.7], ...
   'Callback','epromdata;',...
   'FontName','楷体_GB2312', ...
   'FontSize',20, ...
   'FontWeight','demi', ...
   'ListboxTop',0, ...
   'Position',[595 410 150 26], ...
   'String','生成烧写文件', ...
   'Enable','on',...
   'Tag','生成ROM文件');


%---------------------------------------------图形显示框---------------------------------------------------
show1 = axes('Box','on', ...
	'CameraUpVector',[0 1 0], ...
	'Color',[1 1 1], ...
   'LineWidth',1, ...
	'Position',[0.06 0.10 0.40 0.45], ...
	'Tag','Axes1', ...
   'TickDirMode','manual', ...
   'Xgrid','on',...
   'Ygrid','on',...
	'XColor',[0.8 0.8 0.8], ...
	'YColor',[0.8 0.8 0.8], ...
	'ZColor',[0 0 0]);
show2 = axes('Box','on', ...
	'CameraUpVector',[0 1 0], ...
	'Color',[1 1 1], ...
   'LineWidth',1, ...
	'Position',[0.55 0.10 0.40 0.45], ...
	'Tag','Axes1', ...
   'TickDirMode','manual', ...
   'Xgrid','on',...
   'Ygrid','on',...
	'XColor',[0.8 0.8 0.8], ...
	'YColor',[0.8 0.8 0.8], ...
	'ZColor',[0 0 0]);


⌨️ 快捷键说明

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