Error using STLWRITE function

조회 수: 12 (최근 30일)
Anurah Sajan
Anurah Sajan 2022년 3월 11일
편집: DGM 2025년 7월 3일
tr=triangulation(whitevol.faces,whitevol.vertices);
figure('color','w'), h=trimesh(tr); axis equal
% now write to STL
stlwrite(tr,'cranialSegment.stl');
I'm trying to compute and export a .stl file using the code above. However I keep getting the errors mentioned below. What does this error mean? I was able to export the 3D data before just fine, but for some reason I am now getting these errors.
Error using fileparts (line 58)
Input must be a row vector of characters, or a string scalar, or a cellstr, or a string
matrix.
Error in stlwrite (line 70)
path = fileparts(filename);
Error in test3 (line 133)
stlwrite(tr,'cranialSegment.stl','binary');

채택된 답변

Cris LaPierre
Cris LaPierre 2022년 3월 11일
편집: Cris LaPierre 2022년 3월 11일
You appear to be trying to use MATLAB's stlwrite function, but the error messages suggest you are using this one from the File Exchange instead.
To use MATLAB's function, remove the File Exchange function's folder from you MATLAB Path (or delete it).
If you want to use the file exchange function, follow the syntax requirements for that function.
function stlwrite(filename, varargin)
  댓글 수: 1
Rahand Dalshad
Rahand Dalshad 2022년 4월 10일
Thank you.
I had the same issue because of the stlwrite function loaded from the exchange. Solved my issue after removing it.

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by