I have defined the symbolic function as follows:
syms g(x,w)g(x,w) = norm(w);
Then I have tested it using a symbolic variable:
v = sym('v', [1,2]);g(x,v)
It only gives me the magnitude of of each entry of the vector, rather than the magnitude of the whole vector which is what I want:
ans = [ (abs(v1)^2)^(1/2), (abs(v2)^2)^(1/2)]
How can I change it so it yields the norm of the whole vector? I would greatly appreciate your help!
Best Answer