I have an array of data I want to plot circular contour with those data

조회 수: 3 (최근 30일)
Sils_B
Sils_B 2020년 3월 5일
댓글: Sils_B 2020년 3월 5일
I got Temperature =
200.00
199.94
199.85
199.71
199.51
199.26
198.96
198.60
198.18
197.72
197.20
as a column matrix. Now I want to plot circular contour whose Z value will change radially with given temperature.
For example: at radius=1 all Z values will be 200; For radius=2 all Z value will be 199.94....so on..
How to do that?
  댓글 수: 2
darova
darova 2020년 3월 5일
Can you show your attempts? Do you know how the result should look like?
Sils_B
Sils_B 2020년 3월 5일
please see the .jpg file. and these contour should be concentric circle with uniform radial gap.

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

채택된 답변

darova
darova 2020년 3월 5일
Here is my solution
clc,clear
T = [200.00
199.94
199.85
199.71
199.51
199.26
198.96
198.60
198.18
197.72
197.20];
r = linspace(1,15,length(T));
t = linspace(0,2*pi,50);
%% SHORTER VERSION
[x,y] = pol2cart(t,1);
[Z,X] = meshgrid(T,x);
[~,Y] = meshgrid(T,y);
[R,~] = meshgrid(r,x);
subplot(121)
pcolor(R.*X,R.*Y,Z)
axis vis3d
%% MORE READABLE VERSION
[X,Y,Z] = deal( zeros(length(T),length(t)) );
for i = 1:size(X,1)
X(i,:) = r(i).*cos(t);
Y(i,:) = r(i).*sin(t);
Z(i,:) = T(i);
end
subplot(122)
pcolor(X,Y,Z)
axis vis3d

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by