How to get norm (magnitude) of a vector the simple way?

3 views (last 30 days)
I just want to get the norm of
syms phi the;
c = [-cos(phi)*sin(the)^2;-sin(phi)*sin(the)^2; - cos(the)*sin(the)*cos(phi)^2 - cos(the)*sin(the)*sin(phi)^2]
isn't really simplifying anything
If I type it manually:
I get a simple answere:
Niklas Kurz
Niklas Kurz on 8 May 2021
I'm sorry for forgetting the simicolons in c. It might have been hard for you to reproduce what I was trying to create.

Sign in to comment.

Accepted Answer

Nagasai Bharat
Nagasai Bharat on 7 May 2021
From the documentation of norm and simplify you could find the usage of both these functions. norm would be used to calculate the norm of a vector/matrix but not for an expression. simpify would be used in the simplification of an algebric expression.
  1 Comment
Niklas Kurz
Niklas Kurz on 8 May 2021
Edited: Niklas Kurz on 8 May 2021
well, it actually works if u were to incorporate some assumptions:
assume(phi>0);assume(the>0); assume(phi,'real'); assume(the,'real')
then, under these conditions
will simplify a lot (actually >0 not necessary)

Sign in to comment.

More Answers (0)


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by