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!