How to create a grid of squares and attribute a color to the squares like in a contour plot?

6 views (last 30 days)
Hello,
I want to reproduce the plots from a paper called "Fundamentals for Energy-Efficient Massive MIMO" where the author creates a 8x16 grid and gives temperature values for the contours like you can see here. The only "required" plot is (a), but it should be easy to reproduce (b) once (a) is done.
The problem is where to start with this. Can someone please point me directions?

Answers (1)

darova
darova on 22 Mar 2021
Here is the idea
clc,clear
t = linspace(0,360,5)+45; % create angles
t = [t-2 t+2]; % add shifted angles
t1 = sort(t); % sorting
[x,y] = pol2cart(t1*pi/180,1); % convert to cartesian
x(x>0) = x(x>0) + 1; % move right part to right
x(x<0) = x(x<0) - 1; % move left part to left
% create surface
X = [x/10; x];
Y = [y/10; y];
Z = [x*0+1; x*0];
contour3(X,Y,Z,0:0.2:1)
surface(X,Y,Z)
view(45,45)

Categories

Find more on Contour Plots in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!