## Magnitude of a vector

### Philosophaie (view profile)

on 5 Sep 2013
Latest activity Commented on by Abdullraheem Diab

on 30 Jun 2019

### Shashank Prasanna (view profile)

syms x y z
r = [x y z]
rmag???
rmag should equal (x^2 + y^2 + z^2)^0.5

Show 1 older comment
Philosophaie

### Philosophaie (view profile)

on 5 Sep 2013
I am looking for the magnitude of the vector r. It should be equal to r = (x^2 + y^2 + z^2)^0.5.
Prashant C

### Prashant C (view profile)

on 3 Jun 2015
use the function norm(r) or mag=sqrt(sum(r.*r))
Abdullraheem Diab

on 30 Jun 2019
Sqrt(sum(r.^2))

### Shashank Prasanna (view profile)

on 5 Sep 2013
Edited by MathWorks Support Team

### MathWorks Support Team (view profile)

on 22 May 2019

This works perfectly fine on MATLAB R2013a:
>> syms x y z
r = [x y z];
norm(r)

Shashank Prasanna

### Shashank Prasanna (view profile)

on 5 Sep 2013
What version of MATLAB are you using? Can you confirm that you see the file when you run this:
>> which sym/norm
Bhuvana Krishnaraj

### Bhuvana Krishnaraj (view profile)

on 3 Jun 2019
2015.a version >>which sym/nom C:\matlab\toolbox\symbolic\@!sym\norm.m

### Azzi Abdelmalek (view profile)

on 5 Sep 2013

m=sqrt(x^2+y^2+z^2)