📄 radarsim2.m
字号:
% --- Executes during object creation, after setting all properties.function FMax_CreateFcn(hObject, eventdata, handles)% hObject handle to FMax (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');endfunction FStep_Callback(hObject, eventdata, handles)% hObject handle to FStep (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 FStep as text% str2double(get(hObject,'String')) returns contents of FStep as a doubleMparam=evalin('base','Mparam');FStep = str2double(get(hObject, 'String'));if isnan(FStep) set(hObject, 'String', 0); errordlg('必须输入一个数字','错误');end% Save the new FStep valueMparam.FStep = FStep;assignin('base','Mparam',Mparam);% --- Executes during object creation, after setting all properties.function FStep_CreateFcn(hObject, eventdata, handles)% hObject handle to FStep (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');endfunction R_Callback(hObject, eventdata, handles)% hObject handle to R (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 R as text% str2double(get(hObject,'String')) returns contents of R as a double% --- Executes during object creation, after setting all properties.function R_CreateFcn(hObject, eventdata, handles)% hObject handle to R (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');endfunction DeltaR_Callback(hObject, eventdata, handles)% hObject handle to DeltaR (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 DeltaR as text% str2double(get(hObject,'String')) returns contents of DeltaR as a doubleMparam=evalin('base','Mparam');DeltaR = str2double(get(hObject, 'String'));if isnan(DeltaR) set(hObject, 'String', 0); errordlg('必须输入一个数字','错误');end% Save the new DeltaR valueMparam.DeltaR = DeltaR;assignin('base','Mparam',Mparam);% --- Executes during object creation, after setting all properties.function DeltaR_CreateFcn(hObject, eventdata, handles)% hObject handle to DeltaR (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');endfunction ThetaB_Callback(hObject, eventdata, handles)% hObject handle to ThetaB (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 ThetaB as text% str2double(get(hObject,'String')) returns contents of ThetaB as a doubleMparam=evalin('base','Mparam');ThetaB = str2double(get(hObject, 'String'));if isnan(ThetaB) set(hObject, 'String', 0); errordlg('必须输入一个数字','错误');end% Save the new ThetaB valueMparam.ThetaB = ThetaB;assignin('base','Mparam',Mparam);% --- Executes during object creation, after setting all properties.function ThetaB_CreateFcn(hObject, eventdata, handles)% hObject handle to ThetaB (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');endfunction OmgB_Callback(hObject, eventdata, handles)% hObject handle to OmgB (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 OmgB as text% str2double(get(hObject,'String')) returns contents of OmgB as a doubleMparam=evalin('base','Mparam');OmgB = str2double(get(hObject, 'String'));if isnan(OmgB) set(hObject, 'String', 0); errordlg('必须输入一个数字','错误');end% Save the new OmgB valueMparam.OmgB = OmgB;assignin('base','Mparam',Mparam);% --- Executes during object creation, after setting all properties.function OmgB_CreateFcn(hObject, eventdata, handles)% hObject handle to OmgB (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% --- Executes on selection change in grSelCalc.function grSelCalc_Callback(hObject, eventdata, handles)% hObject handle to grSelCalc (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns grSelCalc contents as cell array% contents{get(hObject,'Value')} returns selected item from grSelCalcEparam=evalin('base','Eparam');selc = get(hObject,'Value');switch selc case 1 set(handles.panelEr,'Visible','off'); set(handles.panelPr,'Visible','off'); set(handles.panelPs,'Visible','off'); set(handles.panelSi,'Visible','on'); set(handles.grSelView,'Visible','off'); set(handles.panelFreq,'Visible','off'); set(handles.panelDis,'Visible','off'); case 3 set(handles.panelEr,'Visible','on'); set(handles.panelPr,'Visible','off'); set(handles.panelPs,'Visible','off'); set(handles.panelSi,'Visible','off'); set(handles.grSelView,'Visible','on'); set(handles.panelFreq,'Visible','on'); set(handles.panelDis,'Visible','on');% Eparam.calc='Er'; case 4 set(handles.panelEr,'Visible','off'); set(handles.panelPr,'Visible','on'); set(handles.panelPs,'Visible','off'); set(handles.panelSi,'Visible','off'); set(handles.grSelView,'Visible','on'); set(handles.panelFreq,'Visible','on'); set(handles.panelDis,'Visible','on');% Eparam.calc='Pr'; case 5 set(handles.panelEr,'Visible','off'); set(handles.panelPr,'Visible','off'); set(handles.panelPs,'Visible','on'); set(handles.panelSi,'Visible','off'); set(handles.grSelView,'Visible','on'); set(handles.panelFreq,'Visible','on'); set(handles.panelDis,'Visible','on');% Eparam.calc='Ps';endEparam.selc=selc;assignin('base','Eparam',Eparam);% --- Executes during object creation, after setting all properties.function grSelCalc_CreateFcn(hObject, eventdata, handles)% hObject handle to grSelCalc (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: listbox 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% --- Executes on selection change in grSelView.function grSelView_Callback(hObject, eventdata, handles)% hObject handle to grSelView (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns grSelView contents as cell array% contents{get(hObject,'Value')} returns selected item from grSelViewEparam=evalin('base','Eparam');selc = get(hObject,'Value');switch selc case 1 set([handles.dmax,handles.dstep,handles.text34,handles.text35],'Visible','off'); set([handles.FMax,handles.FStep,handles.text31,handles.text32],'Visible','on'); Eparam.viewx='fx'; case 2 set([handles.dmax,handles.dstep,handles.text34,handles.text35],'Visible','on'); set([handles.FMax,handles.FStep,handles.text31,handles.text32],'Visible','off'); Eparam.viewx='dx';endassignin('base','Eparam',Eparam);% --- Executes during object creation, after setting all properties.function grSelView_CreateFcn(hObject, eventdata, handles)% hObject handle to grSelView (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called% Hint: popupmenu 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% --- Executes on selection change in grSelViewY.function grSelViewY_Callback(hObject, eventdata, handles)% hObject handle to grSelViewY (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)% Hints: contents = get(hObject,'String') returns grSelViewY contents as cell array% contents{get(hObject,'Value')} returns selected item from grSelViewYset(handles.axesEr,'Visible','on');Eparam=evalin('base','Eparam');CData=evalin('base','CData');grFreq=CData.grFreq;grDis=CData.grDis;viewx=Eparam.viewx;fafalse=Eparam.fafalse;level = get(hObject,'Value')+fafalse;axes(handles.axesEr);% 关闭ActiveX控件。if isfield(handles,'spreadsheet') && ishandle(handles.spreadsheet) delete(handles.spreadsheet);endEparam.graph=0;if get(handles.grHold,'Value')==1 hold on;else hold off; cla;endswitch level case 1 case 2 % 海浪散射截面曲线。 sigemadB=CData.sigemadB; eta=-4:0.01:4; eta=eta'; plot(eta,sigemadB); 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; if viewx=='fx'% rows=size(grFreq,1);% grNa=grNa*ones(rows,1); semilogx(grFreq,grATMO2,'--xb',grFreq,grGAL2,'-.*R',grFreq,grMANMADE2,':oG',grFreq,grNa2,'-b.'); xlabel('频率(MHz)'); ylabel('环境噪声系数'); legend('ATMO','GAL','MANMADE','OVERALL'); elseif viewx=='dx' rows=size(grDis,1); grATMO2=grATMO2*ones(rows,1); grGAL2=grGAL2*ones(rows,1); grMANMADE2=grMANMADE2*ones(rows,1); grNa2=grNa2*ones(rows,1); semilogx(grDis,grATMO2,'--xb',grDis,grGAL2,'-.*R',grDis,grMANMADE2,':oG',grDis,grNa2,'-b.'); xlabel('距离(km)'); ylabel('环境噪声系数'); legend('ATMO','GAL','MANMADE','OVERALL'); end case 4 % 环境噪声曲线(Pa)。 grATMO=CData.grATMO; grGAL=CData.grGAL; grMANMADE=CData.grMANMADE; grNa=CData.grNa; if viewx=='fx'% rows=size(grFreq,1);% grNa=grNa*ones(rows,1); semilogx(grFreq,grATMO,'--xb',grFreq,grGAL,'-.*R',grFreq,grMANMADE,':oG',grFreq,grNa,'-b.');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -