How to get norm (magnitude) of a vector the simple way?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Niklas Kurz
am 4 Mai 2021
Bearbeitet: Niklas Kurz
am 8 Mai 2021
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]
norm(c,2)
isn't really simplifying anything
If I type it manually:
simplify(sqrt(cos(phi)^2*sin(the)^4+sin(phi)^2*sin(the)^4+sin(the)^2*cos(the)^2))
I get a simple answere:
(sin(the)^2)^(1/2)
5 Kommentare
David Goodmanson
am 6 Mai 2021
Hi Niklas,
If your last two vector elements were
- cos(the)*sin(the)*cos(phi) - cos(the)*sin(the)*sin(phi)
i.e. cos(phi) and sin(phi) not squared, then you would get what you say. But since cos(phi) and sin(phi) are squared, you don't.
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!