function prop(f,u,q,sq)%Define stuff
SQ=[]; Q=[];g=size(q);%Evaluation of f with q
Q=subs(f,u,q);%Uncertainty
for h=1:g(1,2); Sq=subs(((diff(f,u(1,h)))^2*sq(1,h)^2),u,q); SQ=sqrt(sum([SQ Sq]));end[Q SQ]end
The function requires for f a symbolic function, u a row vector with all the variables being used in f, q a row vector that contains values for these variables and sq also some values. (so a symbolic function with n variables and then three 1 x n row vectors). For example f=u1+u2, u=[u1 u2], q=[1 2] and sq=[0.1 0.2].
It outputs a 1×2 matrix, yet when I try
A=[]A=[A prop(f,u,[1 2],[0.1 0.2])]
I get "??? Error using ==> prop Too many output arguments."
How can I fix this? I need the output of this function to be used in another function which uses this function multiple times for varying q vectors (and then adding the varying output 1×2 vectors to one big vector)
Best Answer