Making a look-up table periodic

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?

 Respuesta aceptada

Chunru
Chunru el 12 de Nov. de 2021
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 comentarios

MARCO LORENZI
MARCO LORENZI el 12 de Nov. de 2021
Thank you for the help, but i cannot use the wrap function since to make the model work i just had to unwrap the input (it was going -180 to 180 and i also needed that to run from -inf to +inf
Chunru
Chunru el 12 de Nov. de 2021
The input to "wrapTo180" is from -inf to inf.
MARCO LORENZI
MARCO LORENZI el 12 de Nov. de 2021
Editada: MARCO LORENZI el 12 de Nov. de 2021
As you can see here i needed to unwrap my alpha (the left blockset) to erase a discontinuity. In doing this alpha goes from -inf to +inf with no issues. The only issue goes with the tables cause i have values of the table output only for the -180 180 interval.
Chunru
Chunru el 14 de Nov. de 2021
You just neet to insert a matlab function block and using the wrapTo180 function.
MARCO LORENZI
MARCO LORENZI el 16 de Nov. de 2021
Thank you very much for the help!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Aerospace Blockset en Centro de ayuda y File Exchange.

Productos

Versión

R2021a

Preguntada:

el 12 de Nov. de 2021

Comentada:

el 16 de Nov. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by