I Want to convert 2D profile into 3D profile

1 回表示 (過去 30 日間)
vilas math
vilas math 2021 年 5 月 19 日
コメント済み: vilas math 2021 年 5 月 19 日
clc
close all
clear all
zv = linspace(-20,20);
phiv = linspace(0,2*pi,size(zv,2));
rv = ones(1,100,size(zv,1))* 1;
rv2 = -0.9*exp(-1.2*(phiv-4).^2)+1;
%[Theta, R] = meshgrid(phiv,rv);
for i = 0 : 0.9
zb1 = -(i).*exp(-1.2*(phiv-4).^2)+1;
end
%mesh(Theta,R,zv)
figure(1)
plot3(phiv,rv,zv)
hold on
plot3(phiv,rv2,zv)
hold on
plot3(phiv,rv,zb1(1,:))
axis equal
[x,y,z] = pol2cart(phiv,rv,zv);
[x2,y2,z2] = pol2cart(phiv,rv2,zv);
[x3,y3,z3] = pol2cart(phiv,rv,zb1);
figure(2)
plot3(x,y,z)
hold on
plot3(x2,y2,z3)
hold on
plot3(x3,y3,z3(1,:))
axis equal

採用された回答

KSSV
KSSV 2021 年 5 月 19 日
m = 100 ; n = 100 ;
zv = linspace(-20,20,m);
phiv = linspace(0,2*pi,n);
[zv, phiv] = meshgrid(zv,phiv) ;
rv = ones(size(zv))*1;
rv2 = -0.9*exp(-1.2*(phiv-4).^2)+1;
%[Theta, R] = meshgrid(phiv,rv);
L = 0 : 0.9 ;
zb1 = zeros(m,n,length(L)) ;
for i = 1:length(L)
zb1(:,:,i) = -L(i).*exp(-1.2*(phiv-4).^2)+1;
end
%mesh(Theta,R,zv)
figure(1)
plot3(phiv,rv,zv)
hold on
plot3(phiv,rv2,zv)
hold on
plot3(phiv,rv,zb1(:,:,1))
axis equal
[x,y,z] = pol2cart(phiv,rv,zv);
[x2,y2,z2] = pol2cart(phiv,rv2,zv);
[x3,y3,z3] = pol2cart(phiv,rv,zb1);
figure(2)
plot3(x,y,z)
hold on
plot3(x2,y2,z3)
hold on
plot3(x3,y3,z3(1,:))
axis equal
  3 件のコメント
KSSV
KSSV 2021 年 5 月 19 日
Any pictorial example?
vilas math
vilas math 2021 年 5 月 19 日
  • I am trying create 3d plot for that curve which is in the middle instead of circle's 3D profile
  • whose variation can be done by using gaussian formula (rv2).
  • But i am unable to create 3D profile of it

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

その他の回答 (0 件)

カテゴリ

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