📄 radarsim.m
字号:
% handles structure with handles and user data (see GUIDATA)
set(handles.axesEr,'Visible','off');
Eparam=evalin('base','Eparam');
flag=Eparam.graph;
if flag==0
Eparam.graph=1;
assignin('base','Eparam',Eparam);
% 获得仿真数据
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Eparam=evalin('base','Eparam');
CData=evalin('base','CData');
grFreq=CData.grFreq;
grDis=CData.grDis;
viewx=Eparam.viewx;
level=Eparam.level;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 生成ActiveX控件。
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
set(handles.axesEr,'units','pixels');
pos=get(handles.axesEr,'position');
set(handles.axesEr,'units','normalized');
try
handles.spreadsheet = actxcontrol('OWC11.Spreadsheet.11',...
[pos(1)+18 pos(2)+45 pos(3) pos(4)],handles.figure1);
catch
handles.spreadsheet = actxcontrol('OWC11.Spreadsheet.10',...
[pos(1)+18 pos(2)+45 pos(3) pos(4)],handles.figure1);
end
guidata(hObject,handles);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 填充数据
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
switch level
case 2 % 海浪散射截面曲线。
case 3 % 环境噪声曲线(Fa)。
grATMO=CData.grATMO;
grGAL=CData.grGAL;
grMANMADE=CData.grMANMADE;
grNa=CData.grNa;
grATMO2=grATMO+204;
grGAL2=grGAL+204;
grMANMADE2=grMANMADE+204;
grNa2=grNa+204;
M = ['频率(MHz)',num2cell(grFreq');'ATMO',num2cell(grATMO2');...
'GAL',num2cell(grGAL2');'MANMADE',num2cell(grMANMADE2');'OVERALL',num2cell(grNa2')]'; % 数据
FillGrid(handles.spreadsheet,M); % 写入数据
case 4 % 环境噪声曲线(Fa)。
grATMO=CData.grATMO;
grGAL=CData.grGAL;
grMANMADE=CData.grMANMADE;
grNa=CData.grNa;
M = ['频率(MHz)',num2cell(grFreq');'ATMO(dB,W)',num2cell(grATMO');...
'GAL(dB,W)',num2cell(grGAL');'MANMADE(dB,W)',num2cell(grMANMADE');'OVERALL(dB,W)',num2cell(grNa')]'; % 数据
FillGrid(handles.spreadsheet,M); % 写入数据
case 5 % 地波场强曲线。
grEr=CData.grEr;
M = ['频率(MHz)',num2cell(grFreq');'距离(kM)',num2cell(grDis');'场强(dB,uV/m)',num2cell(grEr')]'; % 数据
FillGrid(handles.spreadsheet,M); % 写入数据
case 6 % 地波衰减曲线。
grBTL=CData.grBTL;
M = ['频率(MHz)',num2cell(grFreq');'距离(kM)',num2cell(grDis');'衰减(dB)',num2cell(grBTL')]'; % 数据
FillGrid(handles.spreadsheet,M); % 写入数据
case 7 % 回波功率曲线。
grPr=CData.grPr;
M = ['频率(MHz)',num2cell(grFreq');'距离(kM)',num2cell(grDis');'功率(dB,W)',num2cell(grPr')]'; % 数据
FillGrid(handles.spreadsheet,M); % 写入数据
case 8 % 海杂波功率曲线。
grPs=CData.grPs;
M = ['频率(MHz)',num2cell(grFreq');'距离(kM)',num2cell(grDis');'谱密度(dB,W)',num2cell(grPs')]'; % 数据
FillGrid(handles.spreadsheet,M); % 写入数据
case 9 % 回波信噪(干)比曲线。
grSCR=CData.grSCR;
M = ['频率(MHz)',num2cell(grFreq');'距离(kM)',num2cell(grDis');'信噪比(dB)',num2cell(grSCR')]'; % 数据
FillGrid(handles.spreadsheet,M); % 写入数据
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
guidata(hObject,handles);
set(handles.spreadsheet,'AutoFit',1); % not 'true'
set(handles.spreadsheet,'DisplayOfficeLogo',0); % not 'true'
end
% --- Executes on button press in grPlotBrowser.
function grPlotBrowser_Callback(hObject, eventdata, handles)
% hObject handle to grPlotBrowser (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% 关闭ActiveX控件。
if isfield(handles,'spreadsheet') && ishandle(handles.spreadsheet)
delete(handles.spreadsheet);
end
viewmenufcn(handles.figure1,'PlotBrowser');
function Pt_Callback(hObject, eventdata, handles)
% hObject handle to Pt (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 Pt as text
% str2double(get(hObject,'String')) returns contents of Pt as a double
Mparam=evalin('base','Mparam');
Pt = str2double(get(hObject, 'String'));
if isnan(Pt)
set(hObject, 'String', 0);
errordlg('必须输入一个数字','错误');
end
% Save the new Pt value
Mparam.Pt = Pt;
assignin('base','Mparam',Mparam);
% --- Executes during object creation, after setting all properties.
function Pt_CreateFcn(hObject, eventdata, handles)
% hObject handle to Pt (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 Dt_Callback(hObject, eventdata, handles)
% hObject handle to Dt (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 Dt as text
% str2double(get(hObject,'String')) returns contents of Dt as a double
Mparam=evalin('base','Mparam');
Dt = str2double(get(hObject, 'String'));
if isnan(Dt)
set(hObject, 'String', 0);
errordlg('必须输入一个数字','错误');
end
% Save the new Dt value
Mparam.Dt = Dt;
assignin('base','Mparam',Mparam);
% --- Executes during object creation, after setting all properties.
function Dt_CreateFcn(hObject, eventdata, handles)
% hObject handle to Dt (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 Dr_Callback(hObject, eventdata, handles)
% hObject handle to Dr (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 Dr as text
% str2double(get(hObject,'String')) returns contents of Dr as a double
Mparam=evalin('base','Mparam');
Dr = str2double(get(hObject, 'String'));
if isnan(Dr)
set(hObject, 'String', 0);
errordlg('必须输入一个数字','错误');
end
% Save the new Dr value
Mparam.Dr = Dr;
assignin('base','Mparam',Mparam);
% --- Executes during object creation, after setting all properties.
function Dr_CreateFcn(hObject, eventdata, handles)
% hObject handle to Dr (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 Po_Callback(hObject, eventdata, handles)
% hObject handle to Po (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 Po as text
% str2double(get(hObject,'String')) returns contents of Po as a double
Mparam=evalin('base','Mparam');
Po = str2double(get(hObject, 'String'));
if isnan(Po)
set(hObject, 'String', 0);
errordlg('必须输入一个数字','错误');
end
% Save the new Po value
Mparam.Po = Po;
assignin('base','Mparam',Mparam);
% --- Executes during object creation, after setting all properties.
function Po_CreateFcn(hObject, eventdata, handles)
% hObject handle to Po (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 Gamma_Callback(hObject, eventdata, handles)
% hObject handle to Gamma (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 Gamma as text
% str2double(get(hObject,'String')) returns contents of Gamma as a double
Mparam=evalin('base','Mparam');
Gamma = str2double(get(hObject, 'String'));
if isnan(Gamma)
set(hObject, 'String', 0);
errordlg('必须输入一个数字','错误');
end
% Save the new Gamma value
Mparam.Gamma = Gamma;
assignin('base','Mparam',Mparam);
% --- Executes during object creation, after setting all properties.
function Gamma_CreateFcn(hObject, eventdata, handles)
% hObject handle to Gamma (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 PrSigma_Callback(hObject, eventdata, handles)
% hObject handle to PrSigma (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 PrSigma as text
% str2double(get(hObject,'String')) returns contents of PrSigma as a double
Mparam=evalin('base','Mparam');
PrSigma = str2double(get(hObject, 'String'));
if isnan(PrSigma)
set(hObject, 'String', 0);
errordlg('必须输入一个数字','错误');
end
% Save the new PrSigma value
Mparam.PrSigma = PrSigma;
assignin('base','Mparam',Mparam);
% --- Executes during object creation, after setting all properties.
function PrSigma_CreateFcn(hObject, eventdata, handles)
% hObject handle to PrSigma (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 Ls_Callback(hObject, eventdata, handles)
% hObject handle to Ls (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 Ls as text
% str2double(get(hObject,'String')) returns contents of Ls as a double
Mparam=evalin('base','Mparam');
Ls = str2double(get(hObject, 'String'));
if isnan(Ls)
set(hObject, 'String', 0);
errordlg('必须输入一个数字','错误');
end
% Save the new Ls value
Mparam.Ls = Ls;
assignin('base','Mparam',Mparam);
% --- Executes during object creation, after setting all properties.
function Ls_CreateFcn(hObject, eventdata, handles)
% hObject handle to Ls (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 Do_Callback(hObject, eventdata, handles)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -