Loading data from file and plotting curvature

조회 수: 1 (최근 30일)
AB
AB 2016년 8월 22일
댓글: Walter Roberson 2016년 8월 23일
Hello
I have .m file that has the following few initial lines:
surface = struct('vertices', [3029.11 945.424 11.164; ...
3040.28 940.444 12.474; ...
3028.28 937.903 18.1484; ...
])
I am trying to get the values of the vertices mentioned in the matlab file in an array or something that will later on help me plot the patch curvature. How can I load the data and get the plot curvature of the surface?

답변 (1개)

Walter Roberson
Walter Roberson 2016년 8월 23일
Edit the .m so that it uses a different variable name, not "surface", as surface() is an important graphics call that you might need to use.
Then run the .m file, and then access the "vertices" field of the variable that results.
For example,
volume_surface = struct('vertices', [3029.11 945.424 11.164; ...
3040.28 940.444 12.474; ...
3028.28 937.903 18.1484; ...
]);
v = volume_surface.vertices;
%https://www.mathworks.com/matlabcentral/fileexchange/11168-surface-curvature
[K,H,P1,P2] = surfature(v(:,1), v(:,2), v(:,3))
  댓글 수: 3
Walter Roberson
Walter Roberson 2016년 8월 23일
I can also see other surfature routines in the File Exchange.
Walter Roberson
Walter Roberson 2016년 8월 23일
That routine turns out to need a 2D array of X, Y, and Z, which you do not have. See instead
You can pass the surface variable from your file directly into patchcurvature()

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by