Making a look-up table periodic

조회 수: 2 (최근 30일)
MARCO LORENZI
MARCO LORENZI 2021년 11월 12일
댓글: MARCO LORENZI 2021년 11월 16일
Good morning everyone!
I have the following look-up table.
Basically, this table contains a sample that goes from -180 to 180deg and i would like this sample to be repeated with a period of 2*pi. (To be more clear, the input of the table goes from from -inf to +inf but the table manages only -180 to 180deg).
Is it possible?

채택된 답변

Chunru
Chunru 2021년 11월 12일
theta = (-180:180);
x = randn(size(theta));
% Look up table/interpolant
F = griddedInterpolant(theta, x);
% wrap the input to +/-180
y = F(25)
y = -1.1305
y = F(wrapTo180(746))
y = -0.2496
  댓글 수: 5
Chunru
Chunru 2021년 11월 14일
You just neet to insert a matlab function block and using the wrapTo180 function.
MARCO LORENZI
MARCO LORENZI 2021년 11월 16일
Thank you very much for the help!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by