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

📄 pol_submacro.m

📁 The scope of this SCM simulator is to provide an easy-to-use, GUI supported, MATLAB developed applic
💻 M
📖 第 1 页 / 共 5 页
字号:
        tn=zeros(length(valN));
    end
    [Hn Pn tn AoDn AoAn dBS dMS AoDm AoAm Fnm d thetaBS thetaMS OmegaBS OmegaMS thetav sigmaAS sigmaDS sigmaSF PLdB]=MultipathPol(1,d,valR,2,valS,valU,valdBS,valdMS,valv,valN,valM,valfc,BSAP,MSAP,valaBS,valbMS,valrn,valBSAS,valMSAS,0,0,valrDS,valrAS,valt,valX,vald,valthetaBS,valomegaBS,valthetav,valthetaMS,valomegaMS,pn,tn,cor);
    if BSAP==2
        valS=2*valS;
    else
    end
    if MSAP==2
        valU=2*valU;
    else
    end
    H{k}=Hn;
    P{k}=Pn';
    AoD{k}=AoDn';
    AoA{k}=AoAn';
    t{k}=tn'*(10^6);
    AS(k)=sigmaAS;
    DS(k)=sigmaDS*(10^6);
    SF(k)=sigmaSF;
    PL(k)=PLdB;
    C{k}=Capacity(valN,valSNR,Hn,ti,valS,valU);
    if BSAP==2
        valS=valS/2;
    else
    end
    if MSAP==2
        valU=valU/2;
    else
    end
    k=k+1;
end

%-------------------------Correlation--------------------------------------

tii=[1:1:ti]*(0.001*valX);
for k=1:length(tii)
    res(k)=H{valdrop}{valpath,1}{k,1}(valmonBS,valmonMS);
    cap(k)=C{valdrop}(k,1);
    k=k+1; 
end
%------------Correlation end-----------------------------------------------
   
str=get(handles.structure, 'String');
filename='\data{1}.mat';
strfile=[str filename];
i=1;
while exist(strfile)==2
    string=['{' num2str(i) '}'];
    filename=['\data' string];
    filename=[filename '.mat'];
    strfile=[str filename];
    i=i+1;
end
set(handles.structure, 'String', str);
save  ([str filename],'H', 't','P','AoD','AoA','AS','DS','SF','PL','C')
%------------Plots function data-------------------------------------------
plotit=handles.plotit;
if plotit==1
    data{1}=tii;
    data{2}=real(10*log10(res));
    data{3}=tn;
    data{4}=Pn;
    data{5}=ti;
    data{6}=real(xcorr(res,'coeff'));
    data{7}=thetav;
    data{8}=AoAn;
    data{9}=AoDn;
    data{10}=valR;
    data{11}=valN;
    data{12}=d;
    data{13}=BSAP;
    data{14}=valthetaBS;
    data{15}=valomegaBS;
    data{16}=cap;
    data{17}=valv*valfc*(0.001*valX);
    plots(data);
else
end
%-------------Plots data end-----------------------------------------------

set(handles.resd, 'String', d);
set(handles.resthetav, 'String', thetav);
set(handles.resthetaBS, 'String', thetaBS);
set(handles.resthetaMS, 'String', thetaMS);
set(handles.resomegaBS, 'String', OmegaBS);
set(handles.resomegaMS, 'String', OmegaMS);

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

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

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


% --- Executes during object creation, after setting all properties.
function txtmonBS_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txtmonBS (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 txtmonMS_Callback(hObject, eventdata, handles)
% hObject    handle to txtmonMS (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 txtmonMS as txtS
%        str2double(get(hObject,'String')) returns contents of txtmonMS as a double


% --- Executes during object creation, after setting all properties.
function txtmonMS_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txtmonMS (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 popupmenu4.
function popupmenu4_Callback(hObject, eventdata, handles)
% hObject    handle to popupmenu4 (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 popupmenu4 contents as cell array
%        contents{get(hObject,'Value')} returns selected item from popupmenu4


% --- Executes during object creation, after setting all properties.
function popupmenu4_CreateFcn(hObject, eventdata, handles)
% hObject    handle to popupmenu4 (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 during object creation, after setting all properties.
function axes9_CreateFcn(hObject, eventdata, handles)
% hObject    handle to axes9 (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 axes9

%imshow(imread('background.jpg'));




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


% --- Executes during object creation, after setting all properties.
function edit23_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txtS (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 edit24_Callback(hObject, eventdata, handles)
% hObject    handle to txtdBS (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 txtdBS as txtS
%        str2double(get(hObject,'String')) returns contents of txtdBS as a double


% --- Executes during object creation, after setting all properties.
function edit24_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txtdBS (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 edit25_Callback(hObject, eventdata, handles)
% hObject    handle to txtdMS (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 txtdMS as txtS
%        str2double(get(hObject,'String')) returns contents of txtdMS as a double


% --- Executes during object creation, after setting all properties.
function edit25_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txtdMS (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 edit26_Callback(hObject, eventdata, handles)
% hObject    handle to txtN (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 txtN as txtS
%        str2double(get(hObject,'String')) returns contents of txtN as a double


% --- Executes during object creation, after setting all properties.
function edit26_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txtN (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 edit27_Callback(hObject, eventdata, handles)
% hObject    handle to txtM (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 txtM as txtS
%        str2double(get(hObject,'String')) returns contents of txtM as a double


% --- Executes during object creation, after setting all properties.
function edit27_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txtM (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 edit28_Callback(hObject, eventdata, handles)
% hObject    handle to txtfc (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 txtfc as txtS
%        str2double(get(hObject,'String')) returns contents of txtfc as a double


% --- Executes during object creation, after setting all properties.
function edit28_CreateFcn(hObject, eventdata, handles)
% hObject    handle to txtfc (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 edit29_Callback(hObject, eventdata, handles)
% hObject    handle to txtv (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 txtv as txtS
%        str2double(get(hObject,'String')) returns contents of txtv as a double


⌨️ 快捷键说明

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