How do you drop the 'abs' that's sometimes attached to an output when we use the 'norm' function?

조회 수: 4 (최근 30일)
Here is some sample code:
%
syms a theta
param = [a*cos(theta), a*sin(theta), 0]
norm(param)
%
The output is:
(abs(a*sin(theta))^2 + abs(a*cos(theta))^2)^(1/2).
What I want to see is:
(a^2*sin(theta)^2 + a^2*cos(theta)^2)^(1/2)
or the even more simplified version:
a
Any ideas?

답변 (1개)

Walter Roberson
Walter Roberson 2015년 11월 15일
syms a theta real
and you might want to simplify() the result of the norm()
The abs() is there because complex values are assumed.

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by