How to plot data on a curved surface.

2 ビュー (過去 30 日間)
Twinkle C M
Twinkle C M 2022 年 3 月 28 日
編集済み: Sam Chak 2022 年 3 月 28 日
I wanted to plot the data given in a surface:
The x axis should be curved :
The code I used is:
clc;
clear all;
close all;
a=1;
b=1;
x=-a/2:0.01:a/2;
y=-b/2:0.01:b/2;
for i=1:101
for j=1:101
f(j,i)=cos(pi*x(i)/1)*cos(pi*y(j)/1);
end
end
contourf(x,y,f)
colormap(jet)
I wanted to plot the same value of z but x axis should be curved.
  1 件のコメント
Torsten
Torsten 2022 年 3 月 28 日
What do you mean by
"x axis should be curved"
?

サインインしてコメントする。

回答 (2 件)

Twinkle C M
Twinkle C M 2022 年 3 月 28 日
Please see this figure attached

Torsten
Torsten 2022 年 3 月 28 日
You mean
a=1;
b=1;
x=-a/2:0.01:a/2;
y=-b/2:0.01:b/2;
[X,Y] = meshgrid(x,y);
F = cos(pi*X/1).*cos(pi*Y/1)
surf(X,Y,F)
?
  4 件のコメント
Twinkle C M
Twinkle C M 2022 年 3 月 28 日
it is for plotting data on curved surfaces
Sam Chak
Sam Chak 2022 年 3 月 28 日
編集済み: Sam Chak 2022 年 3 月 28 日
The image looks like a section from a cylindrical surface. MATLAB can definitely plot a curved surface. But the curved x-axis (projected in 3-D) as desired by @Twinkle C M may imply a non-Euclidean geometry.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by