Info

この質問は閉じられています。 編集または回答するには再度開いてください。

??? Input argument "MBC_A" is undefined.

1 回表示 (過去 30 日間)
Ferd
Ferd 2012 年 1 月 13 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Error: ??? Input argument "MBC_A" is undefined.
Error in ==> MBCData at 22 mergefilename=MBC_A;
I checked for the file in the working folder and also the function "MBCData" in it. Both are present. The input file name (="MBC_A") is basically a list of parameters with its respective data stored in the workspace. The Mat2MBC function is another function I've created to get a structured format of the data.
I am not sure why it gives me this error.
Any help would be gladly appreciated.
The Part-Code:
function MBCData(MBC_A,MBC_AllVariables) try
mergefilename=MBC_A;
varNames=who('-file',mergefilename);
MBCdata=MATtoMBCstruct(mergefilename,varNames);
save(MBC_AllVariables,'MBCdata');
catch
e=lasterror;
functionworkspace=tosavedworkspace;
assignin('base','fws',functionworkspace);
rethrow(e);
end
end

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 1 月 13 日
How are you invoking the routine? The error message you are seeing is one you would see if you tried to run the program using F5, or selected Run from the menu, or invoked
MBCData
from the command line without passing in any arguments.
  2 件のコメント
Ferd
Ferd 2012 年 1 月 13 日
Yes, I ran it using F5.
Do I need to type in the input and output file, "MBCData(MBC_A,MBC_AllVariables)", in the command window? I can try it.
Walter Roberson
Walter Roberson 2012 年 1 月 13 日
If those are file names, then in the input window you need
MBCData('MBC_A','MBC_AllVariables')

Community Treasure Hunt

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

Start Hunting!

Translated by