필터 지우기
필터 지우기

unwrap the angle code

조회 수: 6 (최근 30일)
Niraj
Niraj 2012년 11월 15일
Hi, I have a vector of angles which are in the range of -360 to 360. I need to unwrap them. I donot have the wrap and unwrap built in function in my old version of MATLAB.
Could any one come up with a small piece of code to unwrap manually?
Thanks please reply.

답변 (1개)

C.J. Harris
C.J. Harris 2012년 11월 15일
Going from a range of -360 to 360 degrees to 0 to 360 degrees is usually called wrapping the angle, not unwrapping. This anonymous function should do the trick:
wrap = @(x)mod(x,360);
Example:
nAngle = -270;
wrap(nAngle)
ans =
90
  댓글 수: 1
Niraj
Niraj 2012년 11월 23일
Thanks for the answer and correcting me..

댓글을 달려면 로그인하십시오.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by