3D graph from scatter
1 次查看(过去 30 天)
显示 更早的评论
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/516802/image.png)
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Surface and Mesh Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!