필터 지우기
필터 지우기

Output Argument Not Assigned During Call

조회 수: 1 (최근 30일)
Andrew
Andrew 2012년 7월 23일
Hello,
I'm in the process of writing some code that calls on a commonly used function which was written by someone else. The problem is that I keep getting the following error message:
??? Output argument "G1" (and maybe others) not assigned during call to
"/MATLAB/Working_Paper_1/gensys.m>gensys".
This "G1" is the first output argument and, as far as I can see, it is assigning a value to it within the function. Nothing related to this output argument is commented out and everything looks like it should work, but it doesn't. Is there anything that could cause this error message that I'm just not seeing or thinking about?
The link to the code is here:
Thanks for the help,
Andrew

답변 (1개)

Jan
Jan 2012년 7월 23일
편집: Jan 2012년 7월 23일
When the zxz flag is set in gensys(), this function return pre-maturely without defining G1. Unfortunately the corresponding warning message has been disabled. A proper message had saved some of your time.
You can check this by either by using the debugger:
dbstop if error
Then Matlab stops, when the error occurs and you can check the reasons. Or set a break point in the code and step through the program until it returns.
Btw. the program is ugly. Useless lines like
div ;
nunstab;
where div and nunstab are variaables, are useful to increase the confusion and waste time only. Overwriting the built-in function exist is a bad idea also. The massive use of commented code is not helpful: Nobody will remove the comment charatcters ever, such that deleting the lines is more useful.

카테고리

Help CenterFile Exchange에서 Debugging and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by