??? Output argument "feature" (and maybe others) not assigned during call to...
이전 댓글 표시
Problem occurs only when same function is used twice in one .m file.
First I define function mser. It is define correctly, and output variables are properly initialized.
When I wrote test script to test same function for different inputs, problem occurs. When I call function first time, it works correctly. When I call it another time, it crashes with comment:
??? Output argument "feature" (and maybe others) not assigned during call to...
Variable "feature" is output of "mser" function. It is not used anywhere in test script. Funny, when I simply split code in two (first part call of function 'mser' for one input, and second part for other input), both test scripts work!
After searching the Internet I found that this kind of error occur, in most, because of bad initialization (or no initialization at all), which in not the case in this function.
Why problem occurs?
답변 (2개)
Friedrich
2011년 7월 8일
1 개 추천
Hi,
could you please post some code which forces this error? I could not reproduce this at all.
댓글 수: 2
Nikola
2011년 7월 8일
Jan
2011년 7월 8일
This code does not call a function called "mser", but "mserf". Therefore the shown code dos not match your description. Please clarify this. The most important part of the error message is cut and replaced by "...".
The problem is, that the mser (or mserf) function does not create the output "feature" (btw. the name shadows a built-in function - better use another name!). So the interesting part is this function, not the caller. Please edit your original question and do *not* append the code as a comment of an answer.
Oleg Komarov
2011년 7월 8일
function:
function a = foo()
A = 1;
end
Now call it
>> out = foo
Error in ==> foo at 2
b = 1;
??? Output argument "a" (and maybe others) not assigned during call to
"C:\Users\Oleg\Desktop\foo.m>foo".
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!