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

📄 radarsimulation.m

📁 this code invert number of a vector
💻 M
📖 第 1 页 / 共 3 页
字号:
% handles    structure with handles and user data (see GUIDATA)

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


% --- Executes during object creation, after setting all properties.
function updateRate_CreateFcn(hObject, eventdata, handles)
% hObject    handle to updateRate (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in recieveChannelBWType.
function recieveChannelBWType_Callback(hObject, eventdata, handles)
% hObject    handle to recieveChannelBWType (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 recieveChannelBWType contents as cell array
%        contents{get(hObject,'Value')} returns selected item from recieveChannelBWType


% --- Executes during object creation, after setting all properties.
function recieveChannelBWType_CreateFcn(hObject, eventdata, handles)
% hObject    handle to recieveChannelBWType (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function RadarBW_Callback(hObject, eventdata, handles)
% hObject    handle to RadarBW (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 RadarBW as text
%        str2double(get(hObject,'String')) returns contents of RadarBW as a double


% --- Executes during object creation, after setting all properties.
function RadarBW_CreateFcn(hObject, eventdata, handles)
% hObject    handle to RadarBW (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end






function samplingRate_Callback(hObject, eventdata, handles)
% hObject    handle to samplingRate (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 samplingRate as text
%        str2double(get(hObject,'String')) returns contents of samplingRate as a double


% --- Executes during object creation, after setting all properties.
function samplingRate_CreateFcn(hObject, eventdata, handles)
% hObject    handle to samplingRate (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function antenaAperture_Callback(hObject, eventdata, handles)
% hObject    handle to antenaAperture (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 antenaAperture as text
%        str2double(get(hObject,'String')) returns contents of antenaAperture as a double


% --- Executes during object creation, after setting all properties.
function antenaAperture_CreateFcn(hObject, eventdata, handles)
% hObject    handle to antenaAperture (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end



function antenaMode_Callback(hObject, eventdata, handles)
% hObject    handle to antenaMode (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 antenaMode as text
%        str2double(get(hObject,'String')) returns contents of antenaMode as a double


% --- Executes during object creation, after setting all properties.
function antenaMode_CreateFcn(hObject, eventdata, handles)
% hObject    handle to antenaMode (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


function edit9_CreateFcn(hObject, eventdata, handles)


% --- Executes on button press in reset.
function reset_Callback(hObject, eventdata, handles)
    set(handles.run,'value',0);
    set(handles.run,'string','Start');
    h = findobj(handles.radarDisplay,'type','line');
    if ishandle(h) delete(h); end
    h = findobj(handles.radarDisplay,'type','text');
    if ishandle(h) delete(h); end
    handles.mountains = [];
    handles.foundTargets = createTargetObj( {},{},{},{},{},{},{},{},{},{} );  % creating an empty object
    guidata(hObject,handles);
    handleRadarControlls(handles,'on');
    set(handles.nTargets,'enable','on');
    set(handles.nMountains,'enable','on');
%     set(handles.bufferAnalyze,'enable','off');
%     set(handles.bufferAnalyze,'value',0);
    set(handles.RCS,'enable','on');
    set(handles.soundOn,'value',0);
    soundOn_Callback(handles.soundOn, eventdata, handles)
    set(handles.scopeDisplay,'value',0);
    scopeDisplay_Callback(handles.scopeDisplay, eventdata, handles)
    ind = get(handles.backgrundColor,'value');
    color = zeros(1,3);
    color(ind+1) = 0.502;
    set(handles.radarDisplay,'color',color);
    set(gca,'xlim',[-100 100]*1e3, 'ylim', [-100 100]*1e3);    
    grid on;
    
    plotDistLines(handles.radarDisplay,10);
    
    
% hObject    handle to reset (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)



function nTargets_Callback(hObject, eventdata, handles)
% hObject    handle to nTargets (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 nTargets as text
%        str2double(get(hObject,'String')) returns contents of nTargets as a double


% --- Executes during object creation, after setting all properties.
function nTargets_CreateFcn(hObject, eventdata, handles)
% hObject    handle to nTargets (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


% --- Executes on selection change in RCS.
function RCS_Callback(hObject, eventdata, handles)
% hObject    handle to RCS (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 RCS contents as cell array
%        contents{get(hObject,'Value')} returns selected item from RCS


% --- Executes during object creation, after setting all properties.
function RCS_CreateFcn(hObject, eventdata, handles)
% hObject    handle to RCS (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
    set(hObject,'BackgroundColor','white');
else
    set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor'));
end


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

% Hint: get(hObject,'Value') returns toggle state of useMatchFilter


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




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

% Hint: place code in OpeningFcn to populate radarDisplay




% --- Executes on button press in placeMaountins.
function placeMaountins_Callback(hObject, eventdata, handles)
    if get(hObject,'value') %placing mountains
        set(handles.run,'visible','off');
        set(handles.bufferAnalyze,'visible','off');
        set(hObject,'FontWeight','bold','FontSize',10);
        title(handles.radarDisplay,'click on display to place mountains');
        hold on;
        set(gcf,'userdata',handles);
        str = ['temp = get(gca,''CurrentPoint''); h=placeClutter(get(gcf,''userdata''),temp(1,1:2)); ' ...
        'set(gcf,''userdata'',h); plot(temp(1,1),temp(1,2),''*k'',''MarkerSize'',10,''tag'',''mountain'');'];
        set(handles.radarDisplay,'buttondownfcn',str);
    else    % finished placing mountains
        set(handles.run,'visible','on');
        set(handles.bufferAnalyze,'visible','on');
        hold off;
         set(hObject,'FontWeight','normal','FontSize',8);
        title(handles.radarDisplay,[]);
        h = findobj(handles.radarDisplay,'tag','mountain');
        delete(h);
        set(handles.radarDisplay,'buttondownfcn',[]);
        guidata(hObject, handles);
        
    end
        
% hObject    handle to placeMaountins (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hint: get(hObject,'Value') returns toggle state of placeMaountins



⌨️ 快捷键说明

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