Azzera filtri
Azzera filtri

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

4 visualizzazioni (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
% Plot into each tile
for i = 1:7
% Get the next tile
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
xlabel('X (m)');
ylabel('Y (m)');
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]);
  1 Commento
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 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
% Plot the coverage area
for i = 1:7
hold on;
% 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!


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


Community Treasure Hunt

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

Start Hunting!

Translated by