How to plot a 3D image through its coordinates?
2 次查看(过去 30 天)
显示 更早的评论
The image below is a result of finite element software (Abaqus). I would like to transfer this result to Matlab, for this object I have the points (for each end of the squares or mesh) and their respective positions in x, y, z. How would it be possible to plot this result in Matlab?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192276/image.jpeg)
I tried using the surf command but did not get interesting results.
I have a list with the co-ordinates, x, y, z. I am performing the following:
clc; clear all; close all;
%import table with values
[X,Y] = meshgrid(x,y);
[Z] = meshgrid(z);
%if i use [X,Y,Z] = (x,y,z), I have a loot of erros;
surf(X,Y,Z)
result:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192278/image.png)
if someone want to test, I generated this simple case of a simple "box".:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192279/image.png)
Thanks in advance!
1 个评论
YT
2018-10-22
*I tried using the surf command but did not get interesting results.
What did you get then?
回答(2 个)
YT
2018-10-22
编辑:YT
2018-10-22
After a quick search, I found this useful function on FEX called scatterbar3. Just download it and put it in your directory with your other files.
You can then use it like this (used the data in your text file):
figure();
set(gcf,'renderer','zbuffer');
scatterbar3(x,y,z,14); %14 is width of bars, just change to liking
axis('off');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/192510/image.jpeg)
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Lighting, Transparency, and Shading 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!