Error when using decsg (PDE Toolbox)

조회 수: 31 (최근 30일)
Richard
Richard 2012년 2월 6일
편집: Matt J 2013년 10월 4일
Hi there,
I recently encountered a problem with the function "decsg.m" of the PDE Toolbox. I normally use this function to generate a FE mesh after segmenting an image. This script has always worked.
I just rerunned some old data, and I got this error:
""Error in decsg (line 103) if isempty(gd), dl1=[]; bt1=[]; dl=[]; bt=[]; msb=[]; return, end
Output argument "dl1" (and maybe others) not assigned during call to "D:\USlib\decsg.m>decsg"."
This is quite weird and very surprising. I checked the input variables, they are all ok. No conflicts ... what's wrong here?
Kind regards
Richard

채택된 답변

Martijn
Martijn 2012년 2월 7일
Please make sure that your input matrix is valid. For example if it defined polygons, please make sure it does not contain any duplicate points.
  댓글 수: 1
Richard
Richard 2012년 2월 8일
Thank you Martijn, this is true: I added the starting coordinates of my polygons at the end to ensure periodicity ... everything works fine now! Sorry for the inconvenience and thank you all for your thoughts and for the help!

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

추가 답변 (2개)

Friedrich
Friedrich 2012년 2월 6일
Hi,
is the variable gd (first input to the descsg function) empty? I am wondering about the location of the decsg.m function. Normally it should be in a subfolder called:
toolbox\pde\decsg.m
Can you run which -all decsg to see if you maybe overlaoded that function?

Richard
Richard 2012년 2월 6일
>> which -all decsg C:\Program Files\MATLAB\R2011b\toolbox\pde\decsg.m
gd is not empty, it's a 204 x 2 matrix
with row 1: 2's (= POLY) with row 2: N (= 101, number of points polygon) with row 3 - 103 : x-coordinates (N = 101) with row 104 - 204 : y-coordinates (N = 101)
colom 1 = P1 (total area) colom 2 = P2 (mid-area, which is substracted)
  댓글 수: 2
Friedrich
Friedrich 2012년 2월 6일
Okay thats strange. Line 103 shouldnt be any trouble maker. If you can reproduce that, I would contact MathWorks and attach the input variables as mat file to your service request. They should now whats going on here and provide you a solution.
Bill Greene
Bill Greene 2012년 2월 6일
Hi Richard,
This is indeed very strange. Since it appears MATLAB is executing
the correct decsg function in your installation, I'm wondering if
the right version of isempty is getting executed.
If you type
which -all isempty
you should get a long list. Do any of these listed entries
look like they might be locally-defined versions?
One more test you might try is to set a break point at the
line in your function where decsg is called. Then, when the
MATLAB debugger stops there during execution, step into decsg.
The file that is opened should be the same as output from your
which -all decsg.
Then try to step into isempty. This should be a MATLAB builtin
so you shouldn't be able to step into this function.
Maybe these tests will give you some clues.
Regards,
Bill

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

카테고리

Help CenterFile Exchange에서 Geometry and Mesh에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by