Filter löschen
Filter löschen

Making a look-up table periodic

2 Ansichten (letzte 30 Tage)
MARCO LORENZI
MARCO LORENZI am 12 Nov. 2021
Kommentiert: MARCO LORENZI am 16 Nov. 2021
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?

Akzeptierte Antwort

Chunru
Chunru am 12 Nov. 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 Kommentare
Chunru
Chunru am 14 Nov. 2021
You just neet to insert a matlab function block and using the wrapTo180 function.
MARCO LORENZI
MARCO LORENZI am 16 Nov. 2021
Thank you very much for the help!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Type Identification finden Sie in Help Center und File Exchange

Produkte


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by