How to convert 3D line plot into 3D surf plot.

조회 수: 2 (최근 30일)
Dereje
Dereje 2019년 6월 1일
댓글: Walter Roberson 2019년 6월 1일
I need help on how to plot the following 3D line plot(plot3) in to a surf plot.
zspan = linspace(0,400);
v0mat = [1 0.01 1];
N = size(v0mat, 1);
zsol = cell(N,1);
v1sol = cell(N,1);
v2sol = cell(N,1);
v3sol = cell(N,1);
v2in = cell(N,1);
for k=1:size(v0mat,1)
v0 = v0mat(k,:);
[z,v] = ode45(@rhs,zspan,v0);
zsol{k} = z;
v1sol{k} = v(:,1);
v2sol{k} = v(:,2);
v3sol{k} = v(:,3);
v2in{k} = v0mat(2) * ones(size(v2sol{k}));
end
all_z = [zsol{:}];
all_v2 = [v2sol{:}];
all_v2in = [v2in{:}];
[X,Y] = meshgrid(all_v2,all_z);
plot3(all_v2, all_z, all_v2in);
xlabel('Velocity,w')
ylabel('Height, z')
zlabel('initial dw')
grid on
function parameters=rhs(z,v)
alpha=0.116;
db= 2*alpha-(v(1).*v(3))./(2*v(2).^2);
dw= (v(3)./v(2))-(2*alpha*v(2)./v(1));
dgmark= -(2*alpha*v(3)./v(1));
parameters=[db;dw;dgmark];
end

답변 (1개)

Shiv  Kumar
Shiv Kumar 2019년 6월 1일
Nice post

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by