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

1 visualizzazione (ultimi 30 giorni)
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 Commento
Varun
Varun il 28 Ago 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?

Accedi per commentare.

Risposte (1)

Shubham
Shubham il 29 Ago 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!

Categorie

Scopri di più su Graphics Object Programming in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by