Function outputs a 1x2 matrix, yet I can't append that matrix to another matrix.
Show older comments
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 1x2 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 1x2 vectors to one big vector)
Accepted Answer
More Answers (0)
Categories
Find more on Symbolic Math Toolbox in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!