How can I only put all the coverage area and FECs in one figure?

2 Ansichten (letzte 30 Tage)
Haitham AL Satai
Haitham AL Satai am 12 Jun. 2023
Beantwortet: Shubham am 29 Aug. 2023
I am trying to put all the coverage area with blue color that is shown below in one figure to see the overlapping area:
At the same time, in another figure, I would like to plot only the FEC, which is equal to 3.8e-3 and shown with white color in the above figure.
The FEC is a threshold, and the area under this threshold is our target.
I was able to plot them all, but in different figures; what I am interested in is plotting only the blue coverage area for the seven cases in one figure and the FEC for cases in one figure.
Something like the illustration, below:
Is it possible? Any assistance, please?
Below is the Matlab mat file
This is my code:
% Create a 2-by-4 layout
tiledlayout(2,4)
% Plot into each tile
for i = 1:7
% Get the next tile
nexttile
A = berMap(i,1);
% caculate the coverage area
isSmaller = cellfun( @(X) X < 3.8e-3, A(:), 'UniformOutput', false);
numSmaller = sum(sum(isSmaller{:} == 1));
% Draw BerMap
Coverage_area = (numSmaller/(41*41))*400; %Important
surf(X_r,Y_r,A{1,1})
colorbar
view(0,90)
xlabel('X (m)');
ylabel('Y (m)');
zlabel('BER');
axis([-L/2 L/2 -W/2 W/2 min(min(A{1,1})) max(max(A{1,1}))]);
grid on;
hold on;
% Plotting the FEC
Amat = cell2mat(berMap(i,1));
Amat(Amat > 3.8e-3) = 0;
Amatrix = Amat;
Amatrix(Amat == 0) = nan;
hSurface = surf(X_r,Y_r,Amatrix);
set(hSurface, 'EdgeColor',[1 1 1],'FaceColor',[1 1 1]);
view(0,90)
end
  1 Kommentar
Varun
Varun am 28 Aug. 2023
Hello! The google drive above does not work! Can you please attach the MAT file to this question by using the paper-clip icon?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shubham
Shubham am 29 Aug. 2023
Hello Haitham AL Satai,
Since the plotting of coverage area and FEC can be done independently, it is possible to make two separate plots as you desire.
You can create one figure and axes and plot all coverage area within this plot using a single for loop. Similarly, you can repeat this task for the FEC.
Pseudocode for the same could look like:
% Create a figure and axes
figure;
axes;
% Plot the coverage area
for i = 1:7
plotCoverageArea(i);
hold on;
end
% Add legends and title
xlabel('X (m)');
ylabel('Y (m)');
In the above code “plotCoverageArea(i)” plots the coverage area in the ith iteration.
Repeat the steps in above pseudocode for FEC as well. Hope this works!

Kategorien

Mehr zu Orange finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by