??? Output argument "feature" (and maybe others) not assigned during call to...
Show older comments
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?
Answers (2)
Friedrich
on 8 Jul 2011
1 vote
Hi,
could you please post some code which forces this error? I could not reproduce this at all.
2 Comments
Nikola
on 8 Jul 2011
Jan
on 8 Jul 2011
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
on 8 Jul 2011
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".
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!