MATLAB: Magnitude of a vector vector syms x y zr = [x y z]rmag??? rmag should equal (x^2 + y^2 + z^2)^0.5 Best Answer This works perfectly fine on MATLAB R2013a:>> syms x y zr = [x y z]; norm(r)http://www.mathworks.com/help/symbolic/norm.html Related SolutionsMATLAB: How to calculate the magnitude of n-dimensional vector by Matlab’s commands I'll assume by "magnitude", you mean the norm. You can just donorm(x)but there are different norms with different results x = randn(10,1); norm(x,2) norm(x,1) norm(x,inf)So you have to know which one you want. Justnorm(x)gives the 2-norm by default. MATLAB: How to convert different variables into one unified variable in a function syms x y z rz = (x^2+y^2) +2fxyz = (x^2 + y^2 +2*z)*r %uses definition of z in terms of x yeqn = r == sqrt(x^2+y^2)rx = solve(eqn, x) %define x in terms of rfr = simplify(subs(fxyz, x, rx)) %substitute definition of x. Simplify Related QuestionL1 normalization of vectorNorm with matrices helpWhat mean normr in matlab?How to plot a Biconic polynomial surface
Best Answer