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

3 ビュー (過去 30 日間)
Guilherme Theis
Guilherme Theis 2021 年 3 月 22 日
回答済み: darova 2021 年 3 月 22 日
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?

回答 (1 件)

darova
darova 2021 年 3 月 22 日
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)

カテゴリ

Help Center および File ExchangeContour Plots についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by