MATLAB Answers

Smoothing jumps when using unwrap()

조회 수: 3(최근 30일)
adeq123
adeq123 12 Dec 2019
댓글: adeq123 12 Dec 2019
Hello,
I need to use atan() function in my code. That results into zig-zag kind of type result when plotting. Therefore I used unwrap() function which solves the issue. Nevertheless after zooming the plot I can see that the resulting plot has small "jumps" in places where it was unwraped. Is there any robust way to reduce those ?
close all;
y = deg2rad(0:0.1:600)
P = atan(2.2757 * tan(y) ./ (1.6545 + 0.1176*tan(y)));
P = unwrap(rad2deg(P));
plot(y,P);
Thanks for help in advance.

  댓글 수: 0

로그인 to comment.

채택된 답변

Alex Mcaulley
Alex Mcaulley 12 Dec 2019
You need to have a jump higher than pi to avoid the small jumps using unwrap (and this is not you case). Then, a trick you can do:
y = deg2rad(0:0.1:600)
P = atan(2.2757 * tan(y) ./ (1.6545 + 0.1176*tan(y)));
P2 = rad2deg(unwrap(2*P)/2);
plot(y,P);

  댓글 수: 1

adeq123
adeq123 12 Dec 2019
Thanks. That was an precise answer.

로그인 to comment.

추가 답변(0개)

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그

제품


릴리스

R2017b

Translated by