1. 程式人生 > 其它 >【雷達通訊】基於matlab GUI相控陣雷達方向圖【含Matlab原始碼 1048期】

【雷達通訊】基於matlab GUI相控陣雷達方向圖【含Matlab原始碼 1048期】

一、簡介

1 相控陣列的基本原理
陣列天線有兩種基本的形式:一種稱為線陣列,所有單元都排列在一條直線上;另一種稱為面陣列,輻射單元排列在一個面上,通常是一個平面。





總之,在波束掃描時,掃描的偏角θ0越大,波束越寬,天線增益越小,因而天線波束效能變差。一般,天線掃描角限制在60°以內。

2 相控陣雷達的基本組成

二、原始碼

function varargout = xiangkongzhen1(varargin)
% XIANGKONGZHEN1 MATLAB code for xiangkongzhen1.fig
%      XIANGKONGZHEN1, by itself, creates a new XIANGKONGZHEN1 or raises the existing
%      singleton*.
%
%      H = XIANGKONGZHEN1 returns the handle to a new XIANGKONGZHEN1 or the handle to
%      the existing singleton*.
%
%      XIANGKONGZHEN1('CALLBACK',hObject,eventData,handles,...) calls the local
%      function named CALLBACK in XIANGKONGZHEN1.M with the given input arguments.
%
%      XIANGKONGZHEN1('Property','Value',...) creates a new XIANGKONGZHEN1 or raises the
%      existing singleton*.  Starting from the left, property value pairs are
%      applied to the GUI before xiangkongzhen1_OpeningFcn gets called.  An
%      unrecognized property name or invalid value makes property application
%      stop.  All inputs are passed to xiangkongzhen1_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 xiangkongzhen1

% Last Modified by GUIDE v2.5 28-Apr-2021 16:47:17

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @xiangkongzhen1_OpeningFcn, ...
                   'gui_OutputFcn',  @xiangkongzhen1_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 xiangkongzhen1 is made visible.
function xiangkongzhen1_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 xiangkongzhen1 (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

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


% --- Outputs from this function are returned to the command line.
function varargout = xiangkongzhen1_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 pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
N=str2num(get(handles.edit1,'String'));
a=str2num(get(handles.edit3,'String'));
thetaB=str2num(get(handles.edit4,'String'));
thetaB1=thetaB/180*pi
theta=-pi:pi/10791:pi;
sum1=0;
for i=0:N-1
    y1=exp(1j*2*pi*i*a*(sin(theta)-sin(thetaB1)));   
    sum1=sum1+y1;
end
sum=abs(sum1);
maxval=max(sum);
sum=sum./maxval; 
axes(handles.axes1);
plot(theta/pi*180,sum,'b');
xlim([-180 180]);
ylim([0 1])
title('線性陣列的歸一化幅度圖');
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
N=str2num(get(handles.edit1,'String'));
a=str2num(get(handles.edit3,'String'));
thetaB=str2num(get(handles.edit4,'String'));
thetaB1=thetaB/180*pi
theta=-pi:pi/10791:pi;
sum1=0;
for i=0:N-1
    y1=exp(1j*2*pi*i*a*(sin(theta)-sin(thetaB1)));   
    sum1=sum1+y1;
end
axes(handles.axes2);
polar(theta,sum1,'-b');
title('線性陣列方向圖');


% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton3 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
N=str2num(get(handles.edit1,'String'));
a=str2num(get(handles.edit3,'String'));
thetaB=str2num(get(handles.edit4,'String'));
thetaB1=thetaB/180*pi
theta=-pi:pi/10791:pi;
sum1=N*pi*a.*(sin(theta)-sin(thetaB1));
sum2=N*sin(sum1)./sum1;
sum=abs(sum2);
maxval=max(sum);
sum=sum./maxval;                       
axes(handles.axes1);
plot(theta/pi*180,sum,'r');
xlim([-180 180]);
ylim([0 1])
title('線性陣列的歸一化幅度圖(取sinc近似)');
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject    handle to pushbutton4 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
N=str2num(get(handles.edit1,'String'));
a=str2num(get(handles.edit3,'String'));
thetaB=str2num(get(handles.edit4,'String'));
thetaB1=thetaB/180*pi
theta=-pi:pi/10791:pi;
sum1=N*pi*a.*(sin(theta)-sin(thetaB1));
sum2=N*sin(sum1)./sum1;
axes(handles.axes2);
polar(theta,sum2,'-r');
title('線性陣列方向圖(取sinc近似)')



function edit1_Callback(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit1 as text
%        str2double(get(hObject,'String')) returns contents of edit1 as a double
globel N;
N=get(handles.edit1,'String');

% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end



function edit2_Callback(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of edit2 as text
%        str2double(get(hObject,'String')) returns contents of edit2 as a double


% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject    handle to edit2 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

三、執行結果



四、備註

版本:2014a
完整程式碼或代寫加1564658423