3D graph from scatter

조회 수: 1 (최근 30일)
Mateusz Brzezinski
Mateusz Brzezinski 2021년 2월 11일
편집: Mateusz Brzezinski 2021년 2월 11일
Hello, I have such a piece of code:
n=1;
i=0;
while i<iFileB
Bl=B{1,n}(:, 1);
Br=B{1,n}(:, 2);
Sl=S{1,n}(:, 1);
Sr=S{1,n}(:, 2);
C=Cr{1,n}(:, 1);
T=Cr{1,n}(:, 2);
ZP=Z{1,1}(n, 1);
sz1=3;
sz2=5;
c1 = 'red';
c2 = 'blue';
c3 = 'magenta';
c4 = 'cyan';
c = linspace(1,10,length(Bl));
scatter3(Bl, T, repmat(ZP, size(Bl)), sz1,c1, 'filled')
hold on
scatter3(Br, T, repmat(ZP, size(Br)), sz1,c2, 'filled')
hold on
scatter3(Sl, T, repmat(ZP, size(Bl)), sz2,c3, 'filled')
hold on
scatter3(Sr, T, repmat(ZP, size(Br)), sz2,c4, 'filled')
hold on
n=n+1;
i=i+1;
end
It gives me this kind of graph:
What I would like to do is to create a figure based on these slices, I mean, I would like to have a solid edge in z dimensions. For instance, if those slices represent a crosssection of a sphere I would like to recreate "this sphere" out of slices. Similar to this https://www.mathworks.com/matlabcentral/answers/313108-how-to-convert-2d-graph-to-3d but in my case, I don't have a fixed equation and my shape changes over Z.
Is there any option to do this in Matlab?
I will be grateful for any help!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by