How to subplot an rfplot when using the RF Budget Analyzer
조회 수: 4 (최근 30일)
이전 댓글 표시
Version: Matlab 2020b (RF toolbox+RF Blockset), Ubuntu Linux 18.04
I have a cascade of multiple RF elements ( rfelement or nport ) objects and I pass them the to rfbudget tool.
elements_10ghz = [ rfelement ];
elements_10ghz(1) = rfelement( 'Name','component_00', 'Gain',-0.17);
elements_10ghz(2) = rfelement( 'Name','component_01', 'Gain', 5);
elements_10ghz(3) = nport( 'allpass.s2p', 'some_nport_00');
elements_12ghz = [ rfelement ];
elements_12ghz(1) = rfelement( 'Name','component_00', 'Gain',-1.2);
elements_12ghz(2) = rfelement( 'Name','component_01', 'Gain', 2);
elements_12ghz(3) = nport( 'allpass.s2p', 'some_nport_00');
b_10ghz = rfbudget( ...
'Elements', elements_10ghz, ...
'InputFrequency', 10e9, ...
'AvailableInputPower', -20, ...
'SignalBandwidth', 1.2e9, ...
'Solver', 'Friis', ...
'AutoUpdate', 0);
b_12ghz = rfbudget( ...
'Elements', elements_12ghz, ...
'InputFrequency', 12e9, ...
'AvailableInputPower', -20, ...
'SignalBandwidth', 1.2e9, ...
'Solver', 'Friis', ...
'AutoUpdate', 0);
Now, to plot the Gain (S21), the rfbudget object features an rfplot method, however, I can't seem to figure out how to either subplot the two charts, or, put them on the same chart with hold on. Everytime that I run rfplot it seems to ignore any figure or subplot calls.
Running the following methods did not work:
% Attempt 1 - Subplotting the 3D graphs = No dice
figure(1); % <- Note this is ignored and the RF plots show as figure 2 and figure 3
subplot(2,1,1);
b_10ghz.rfplot();
subplot(2,1,2);
b_12ghz.rfplot();
% Attempt 2 - Reducing the 3D graph to a 2D one (taking a slice?) = No Dice
figure(1);
subplot(2,1,1);
b_10ghz.rfplot();
xlim([3 4]);
view([90 0]);
subplot(2,1,2);
b_12ghz.rfplot();
xlim([3 4]);
view([90 0]);
% Attempt 3 - Using hold on = No dice
figure(1);
b_10ghz.rfplot();
xlim([3 4]);
view([90 0]);
hold on;
b_12ghz.rfplot();
xlim([3 4]);
view([90 0]);
댓글 수: 0
채택된 답변
Janakinadh
2022년 4월 29일
Hello,
rfplot now accepts axes handle as target. help rfbudget/rfplot
elements_10ghz(1) = rfelement( 'Name','component_00', 'Gain',-0.17);
elements_10ghz(2) = rfelement( 'Name','component_01', 'Gain', 5);
elements_10ghz(3) = nport( 'allpass.s2p', 'some_nport_00');
elements_12ghz(1) = rfelement( 'Name','component_00', 'Gain',-1.2);
elements_12ghz(2) = rfelement( 'Name','component_01', 'Gain', 2);
elements_12ghz(3) = nport( 'allpass.s2p', 'some_nport_00');
b_10ghz = rfbudget( ...
'Elements', elements_10ghz, ...
'InputFrequency', 10e9, ...
'AvailableInputPower', -20, ...
'SignalBandwidth', 1.2e9, ...
'Solver', 'Friis', ...
'AutoUpdate', 0);
b_12ghz = rfbudget( ...
'Elements', elements_12ghz, ...
'InputFrequency', 12e9, ...
'AvailableInputPower', -20, ...
'SignalBandwidth', 1.2e9, ...
'Solver', 'Friis', ...
'AutoUpdate', 0);
fig = figure(10);
ax1 = subplot(2,1,1);
rfplot(ax1,b_10ghz)
ax2 = subplot(2,1,2);
rfplot(ax2,b_12ghz)
Hope this helps. Note that the uitoolbar is connected only to the last rfplot plotted.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 RF Budget Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!