필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Haitham AL Satai
Haitham AL Satai 2023년 6월 12일
답변: Shubham 2023년 8월 29일
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
Varun
Varun 2023년 8월 28일
Hello! The google drive above does not work! Can you please attach the MAT file to this question by using the paper-clip icon?

댓글을 달려면 로그인하십시오.

답변 (1개)

Shubham
Shubham 2023년 8월 29일
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!

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by