📄 myresults.m
字号:
%% This is a Matlab script used to extract simulation data from%% runefc, for the CDMA seminars and homework.%%% Created 2005.04.15 by Bogdan Timus% $Id:$if isfield(par,'myResults'), switch par.myResults, case 'ex1', if ~exist('res'), figure(1); clf; plothex(sys.xyb, sys.fib); axis([-500 5000 -5000 500]); hold on mInx = min(11, length(sta.xym)); mobH = plot(sta.xym(mInx),'b^'); figure(2); clf subplot(3,1,1); pG1 = line(sta.time,sta.gmb(mInx,1),'color','b'); pG2 = line(sta.time,sta.gmb(mInx,2),'color','r'); % pG3 = line([],[],'color','c'); % pG4 = line([],[],'color','m'); grid on ylim([-127 -116]); title('Pathgain'); subplot(3,1,2); pP1 = line(sta.time,max(-10, sta.pdmb(mInx,1)),'color','b'); grid on ylim([-15 30]); title('Pdl cell 1') subplot(3,1,3); pP2 = line(sta.time,max(-10, sta.pdmb(mInx,2)),'color','b'); grid on ylim([-15 30]); title('Pdl cell 2') res.G = [sta.gmb(mInx,1); sta.gmb(mInx,2)]; res.Pdl = [sta.pdmb(mInx,1); sta.pdmb(mInx,2)]; res.xym11 = sta.xym(mInx); res.time = sta.time; else set(mobH,'xdata',real(sta.xym(mInx)),... 'ydata',imag(sta.xym(mInx))); xd = get(pG1,'xdata'); yd = get(pG1,'ydata'); set(pG1,'xdata',[xd sta.time],... 'ydata',[yd sta.gmb(mInx,1)]); xd = get(pG2,'xdata'); yd = get(pG2,'ydata'); set(pG2,'xdata',[xd sta.time],... 'ydata',[yd sta.gmb(mInx,2)]); xd = get(pP1,'xdata'); yd = get(pP1,'ydata'); set(pP1,'xdata',[xd sta.time],... 'ydata',[yd max(-10, sta.pdmb(mInx,1))]); xd = get(pP2,'xdata'); yd = get(pP2,'ydata'); set(pP2,'xdata',[xd sta.time],... 'ydata',[yd max(-10, sta.pdmb(mInx,2))]); res.G = [res.G, [sta.gmb(mInx,1); sta.gmb(mInx,2)]]; res.Pdl = [res.Pdl, [sta.pdmb(mInx,1); sta.pdmb(mInx,2)]]; res.xym11 = [res.xym11, sta.xym(mInx)]; res.time = [res.time, sta.time]; end; drawnow; case 'ex2', % used to look at the power control if ~exist('res'), figure(1); clf; res.pul = []; res.sirul = []; res.time = []; end; res.pul = [res.pul, max(sta.pumb(1:10,:),[],2)]; res.sirul = [res.sirul, linsum(sta.sirumb(1:10,:), 2)]; res.time = [res.time, res.time]; subplot(2,1,1); stairs(res.pul(1,:)); grid on title('Pul mobile nr.1'); ylim([-10 30]); ylabel('[dBm]'); subplot(2,1,2); stairs(res.sirul(1,:)); grid on title('SIRul mobile nr.1'); ylim([-25 -15]); ylabel('[dB]'); drawnow; pause(0.1); case 'ex3', % used to look at the SIR ul distribution if ~exist('res'), figure(1); clf; res.prec = []; res.time = []; end; prec = db2lin(sta.cumb(1,:)) + db2lin(sta.iumb(1,:)); res.prec = [res.prec, lin2db(prec')]; res.time = [res.time, sta.time]; subplot(1,2,1); cdfplotmed(linsum(sta.sirumb, 2)); grid on axis([-23 -13 0 100]); title(sprintf('Uplink SIR at time: %1.3f seconds',sta.time)); xlabel('[dB]'); subplot(1,2,2); cdfplotmed(linsum(sta.sirdmb, 2)); grid on axis([-20 -8 0 100]); title('Downlink SIR'); xlabel('[dB]'); drawnow; plot(0.5); case 'ex4', % used to look at the stability of the system if ~exist('res'), res.prec = []; res.time = []; end; prec = db2lin(sta.cumb(1,:)) + db2lin(sta.iumb(1,:)); res.prec = [res.prec, lin2db(prec')]; res.time = [res.time, sta.time]; otherwise, res(islot, iframe).pumb = sta.pumb; res(islot, iframe).cumb = sta.cumb; res(islot, iframe).iumb = sta.iumb; end; else % The default logging from runefc res(islot, iframe) = sta;end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -