필터 지우기
필터 지우기

How to subplot an rfplot when using the RF Budget Analyzer

조회 수: 7 (최근 30일)
Nicholas Molinski
Nicholas Molinski 2021년 12월 12일
답변: Janakinadh 2022년 4월 29일
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]);

채택된 답변

Janakinadh
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개)

카테고리

Help CenterFile Exchange에서 Glaciology에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by