Why do I get the error '??? Output argument ‹variable› (and maybe others) not assigned during call to ‹function›.' ?

5 ビュー (過去 30 日間)
I am actually trying to run a source code that is termed as FESTIV.m used in Electrical Engineering. It needs another software GAMS to be installed as well and i have installed it as well. now when i am running the festiv.m code. it is giving me this error
Output argument "gamspath" (and maybe others) not assigned during call to "getgamspath".
Error in FESTIV (line 94)
gamspath=getgamspath();
I have attached the festiv.m file.

回答 (3 件)

Rik
Rik 2021 年 9 月 8 日
The error is in getgamspath. Consider this function:
function [output1,output2]=IncorrectFunction
output2=1;
end
Running it results in the error you saw:
answer=IncorrectFunction
Output argument "output1" (and maybe others) not assigned during call to "solution>IncorrectFunction".

Walter Roberson
Walter Roberson 2021 年 9 月 8 日
Reading through https://github.com/NREL/FESTIV_MODEL/blob/master/getgamspath.m I can see that that problem can occur under these circumstances:
  • file pathfile.txt already exists in the current directory, and has exactly one entry that mentions GAMS, but when you use that entry as a foldername to look for gamside.exe then there is no gamside.exe there. In such a case, the code does not give a warning or message: it just fails to set the output variable gamspath; OR
  • file pathfile.txt already exists, and has either more than one entry that mentions GAMS, but when the program asks Windows to CD \ & dir gamside.exe /s then no gamside.exe is found anywhere under \ . This process ignores the contents of pathfile.txt other than to find out that there are multiple GAMS lines. Failure to find the file not strictly imply that gamside.exe does not exist anywhere on the computer: it could mean that it is on a different partition for example.
  • file pathfile.txt does not exist in the current directory, or does exist but has no entries that mention GAMS, but when the program asks Windows to CD \ & dir gamside.exe /s then no gamside.exe is found anywhere under \ . This process ignores the contents of pathfile.txt (if it exists at all) other than to find out that there are no GAMS lines. Failure to find the file not strictly imply that gamside.exe does not exist anywhere on the computer: it could mean that it is on a different partition for example.
Note that it is always the current directory that is looked in when getgamspath is invoked.
Probably the most common circumstance is that the pathfile.txt either does not exist or else is empty. The file is created as empty if it does not exist, but after the function finds what it thinks is a possible path, it does not write the path found into the file, so a slow search for the executable would be done all over again...

Nasir Abbas
Nasir Abbas 2021 年 9 月 8 日
I updated the pathfile.text with the gamside.exe location and then it worked. I am not having the same error again. But now it is giving some other warnings and errors. the screenshot of that error is added.
  6 件のコメント
Walter Roberson
Walter Roberson 2021 年 9 月 8 日
gamside is a user interface, that depends upon gams.exe to do the work.
The installation discussion at https://www.gams.com/36/docs/UG_WIN_INSTALL.html has a mention of an executable named gams near the bottom of the page, which implies that gams.exe is expected to be there.
Nasir Abbas
Nasir Abbas 2021 年 9 月 8 日
i read the whole installation notes for windows but i did not found anything related gams.exe rather they talked about studio..exe.
can the newer verions of softwares be the reason these errors.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by