How to plot a 3D image through its coordinates?

조회 수: 1 (최근 30일)
pml_28
pml_28 2018년 10월 22일
답변: pml_28 2018년 10월 25일
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?
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:
if someone want to test, I generated this simple case of a simple "box".:
Thanks in advance!
  댓글 수: 1
YT
YT 2018년 10월 22일
*I tried using the surf command but did not get interesting results.
What did you get then?

댓글을 달려면 로그인하십시오.

답변 (2개)

YT
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');

pml_28
pml_28 2018년 10월 25일
Hello YT,
Thank you very much for the help, I believe that your solution could be a way too! However, you can perform the plot using the patch function and get satisfactory results. Thanks for the response and for the help!
Example:
patch ('Vertices', vertices, 'Faces', fm, 'FaceVertexCdata', FaceColor, 'FaceColor', 'interp');

카테고리

Help CenterFile Exchange에서 Lighting, Transparency, and Shading에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by