I am trying to create a code e.g.:
function Y=evaluator(a,b,c,d,e,f,g,function1) Y=function1(a,b,c,d,e,f,g); end
such that I can input any .m file as an input argument (for function1) and it would be evaluated with the input arguments (a,b,c,d,e,f,g). In other words, I want to have the code evaluate (say) any ..m file that has 7 input arguments in this code.
My issue is that I get the "Not enough input arguments" Error every time I try to run this, even though function11.m has 7 input variables. Yet if I call up the .m files from the Command Window – i.e. function11(a,b,c,d,e,f,g) – it runs perfectly. What's more, changing Y=function1(a,b,c,d,e,f,g); back to Y=function11(a,b,c,d,e,f,g); (the actual .m file name – as I had before trying to do this, which worked before), the error still pops up and there is nothing I can do about it.
I have also tried using:
Y=feval(function1(a,b,c,d,e,f,g));
with the same result.
Any suggestions/comments?
Best Answer