Making a look-up table periodic

3 次查看(过去 30 天)
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