Error while using Surface Intersection function in a loop "Subscript indices must either be real positive integers or logicals"
古いコメントを表示
Hi everybody, I am struggling with the last part of my Script. I attach here the error and the correlated part of the script.
Script:
for ind1=1:length(Slicesurf)
for ind2=1:(ncontour*2)
[~, intersection] = SurfaceIntersection(Slicesurf(ind1),Htot(ind2));
Infill(ind1,ind2).faces=intersection.faces;
Infill(ind1,ind2).vertices=intersection.vertices;
Infill(ind1,ind2).edges=intersection.edges;
end
end
the curious thing is that the loop goes well for a few rounds but then it stops and give me this error. ncontour and lenght(Slicesurf) are both real and positive. Slicesurf contains all surfaces parallel to xy plane and Htot contains 3D parabolas.
Error:
"Subscript indices must either be real positive integers or logicals.
Error in SurfaceIntersection>TriangleIntersection3D_Moller (line 367)
a2 = lut(sign(du)*[9; 3; 1] + 14); % calculate the key and call the look-up table
Error in SurfaceIntersection (line 218)
[intMatrix(tMsk), intSurface] = TriangleIntersection3D_Moller(...
Error in SurfaceIntersection_prova13 (line 166)
[~, intersection] = SurfaceIntersection(Slicesurf(ind1),Htot(ind2));"
can someone help me? I am going crazy with this error!
Thanks a lot!
2 件のコメント
Gian Marco Tassi
2017 年 10 月 5 日
J P
2020 年 6 月 16 日
Hi, I am currently having the same issue, did you ever find a fix?
回答 (1 件)
James Tursa
2017 年 10 月 5 日
編集済み: James Tursa
2017 年 10 月 5 日
0 投票
Often this is the result of having a variable with the same name as a MATLAB function you are using, so the variable is shadowing the MATLAB function. E.g., maybe you have inadvertently created a variable named "sign" and "du" is not an integer when you encounter sign(du).
カテゴリ
ヘルプ センター および 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!