Commit ec28dbd8 authored by Jan-Gerrit Richter's avatar Jan-Gerrit Richter

ita_parse_arguments: disabled warning if unknown parameters are returned

parent b7aa1751
...@@ -31,3 +31,15 @@ end ...@@ -31,3 +31,15 @@ end
% - % -
%% test moving unknown options to second output
struct.testpar = 1;
struct.testpar2 = 2;
parCell = {'testpar', 2, 'testpar2', 4,'unknown', 6};
% this should give a warning
[sArgs] = ita_parse_arguments(struct,parCell);
% this should not
[sArgs,unknownParams] = ita_parse_arguments(struct,parCell);
...@@ -300,7 +300,9 @@ while (idx <= nArguments) % go through all arguments ...@@ -300,7 +300,9 @@ while (idx <= nArguments) % go through all arguments
end end
if notFoundArguments == 1 if notFoundArguments == 1
ita_verbose_info([thisFuncStr callFuncStr 'Some arguments could not be found in the struct. They are returned separately.'],0); if nargout < 2
ita_verbose_info([thisFuncStr callFuncStr 'Some arguments could not be found in the struct. They are returned separately.'],0);
end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment