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

📄 modespage.m

📁 产生IFF信号MODES询问及应答方式的GUI界面程序.
💻 M
字号:
function varargout = modespage(varargin)
% MODESPAGE M-file for modespage.fig
%      MODESPAGE, by itself, creates a new MODESPAGE or raises the existing
%      singleton*.
%
%      H = MODESPAGE returns the handle to a new MODESPAGE or the handle to
%      the existing singleton*.
%
%      MODESPAGE('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in MODESPAGE.M with the given input arguments.
%
%      MODESPAGE('Property','Value',...) creates a new MODESPAGE or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before modespage_OpeningFunction gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to modespage_OpeningFcn via varargin.
%
%      *See GUI Options on GUIDE's Tools menu.  Choose "GUI allows only one
%      instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Edit the above text to modify the response to help modespage

% Last Modified by GUIDE v2.5 06-Jul-2007 20:21:55

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @modespage_OpeningFcn, ...
                   'gui_OutputFcn',  @modespage_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before modespage is made visible.
function modespage_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to modespage (see VARARGIN)

% Choose default command line output for modespage
handles.output = hObject;

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes modespage wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = modespage_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on button press in modesaskxwxh.
function modesaskxwxh_Callback(hObject, eventdata, handles)
% hObject    handle to modesaskxwxh (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
axes(handles.modesaskaxes1);%在句柄值为axes1中画图
cla;clc;
%模拟modes询问信号产生,P1,P2两个前导脉冲,4.75us处控制脉冲,以及56或102bit的DPSK编码信号
%最后24bit为奇偶验证区
t=[0:0.000000001:0.000100];
%产生同步脉冲信号
d1=[0.000001,0.000003];
y1=pulstran(t,d1,'rectpuls',0.0000008);
%产生旁瓣抑制信号
d2=[0.00000575];
y2=0.8*pulstran(t,d2,'rectpuls',0.0000008);
%产生编码信号
d3=[0.0000065:0.00000025:0.0000205];
y3=pulstran(t,d3,'rectpuls',0.00000024);
%产生截尾脉冲
d4=[0.00002125];
y4=pulstran(t,d4,'rectpuls',0.00000075);
%总的脉冲
y=y1+y2+y3+y4;
plot(t,y)

axis([0,0.000025,-0.5,2])
title('Mode S 询问信号')
xlabel('t');
ylabel('y');
grid;



% --- Executes on button press in modesansydxh.
function modesansydxh_Callback(hObject, eventdata, handles)
% hObject    handle to modesansydxh (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

axes(handles.modesansaxes2);%在句柄值为axes1中画图
cla;clc;
%模拟modes应答信号产生,四个前导脉冲对0,1,3.5,4.5共8us,后由56/112个数据脉冲(PPM调制)组成
t=[0:0.000000001:0.000100];
%产生同步脉冲信号
d1=[0.000001,0.000002,0.0000045,0.0000055];
y1=pulstran(t,d1,'rectpuls',0.0000005);
%产生编码信号
d3=[0.000009:0.000001:0.000065];
y3=pulstran(t,d3,'rectpuls',0.0000005);
%总的脉冲
y=y1+y3;
plot(t,y)

axis([0,0.000070,-0.5,2])
title('Mode S 询问信号')
xlabel('t');
ylabel('y');
grid;

⌨️ 快捷键说明

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