Hello folks, I have to evaluate multiple expressions in loop. Suppose x and y are one dimensional vectors and below three operations are supposed to be performed.
1) min(x)2) min(x) + min(y)3) min(x+min(y))
I am using eval for evaluating these expressions.
for count = 1:3[output,index] = eval(fun(count));end
In case 1 and 3, I need the value of expression and index as eval command sends both. But in case 2, I wont get index with eval and it throws error.
[a,b] = min(x) + min(y)Error using + Too many output arguments.
So in order to generalize, is there any possible way to know in advance that the expression is going to send one or two output arguments?
Best Answer