フィルターのクリア

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 Center および File ExchangeDebugging and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by