Creating a circular contour from radial datasets

조회 수: 7 (최근 30일)
Marc
Marc 2024년 2월 16일
댓글: William Rose 2024년 2월 16일
I've never used contours in Matlab, and I made 0 progress on my case so far. Here's my problem:
My data is stored in multiple radial datasets (six in this example), the discrete points are defined in polar coordinates and/or cartesian. I'd prefer cartesian. My data points are shown in the left picture.
For every Point [y,z], i have a value for my contour data. Lets call it [Fz]. Now i want to create a contour plot, that looks like the right picture. In the "real" case, I have 120 radial datasets 0°:3°:360°, so i do not really rely on interpolation that makes the contour look like a perfect circle as shown in the right picture. What i do need, is the hole in the middle. The contour shall only be plotted for inbetween r_min and r_max.
I have attached my example workspace. Blade1, Blade2, Blade3,... are the radial stations at 0°:60°:360°
Thanks in advance, i really gave up on this one..

채택된 답변

Voss
Voss 2024년 2월 16일
S = load('example.mat');
Blades = [S.Blade1 S.Blade2 S.Blade3 S.Blade4 S.Blade5 S.Blade6];
Blades_plot = Blades([1:end 1]);
y = [Blades_plot.y];
z = [Blades_plot.z];
Fx = [Blades_plot.Fx];
contourf(y,z,Fx)
  댓글 수: 3
Voss
Voss 2024년 2월 16일
You're welcome!
William Rose
William Rose 2024년 2월 16일
Yet another nice answer from @Voss. You can like it.
When you are plotting a physical object, you probably want the aspect ratio to be correct, i.e. 1 cm along x axis equals 1 cm along y. Try
axis equal
to make it so.

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

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by