Let us consider a function of two variable as, f = @(t1,t2)t1.*1.440745596517226e-5-t2.*(t1.*4.427411218097436e-10-1.49134455586144e-5).*1.0+2.5
If we wish to evaluate the value of the function f at vector T = [t1, t2]=[1,1]. The command feval(f, T) gives the following error.
Error using @(t1,t2)t1.*1.440745596517226e-5-t2.*(t1.*4.427411218097436e-10-1.49134455586144e-5).*1.0+2.5 Not enough input arguments.
However f(1,1) or feval (f,1,1) evaluates the value of function at given points. But if the number of variables are very large like say 100 then how to evaluate this function? Manual entry of 100 variables (like: f(1,1) or feval (f,1,1) ) is time consuming and condition gets worse in the iterations where the number of variables may change. Please consider this issue. Thanks in advance from my side.
Best Answer