Interpolating the data given between -pi and pi

I have the following program and wanted to get the value between -π and π. But the program I made below only gives . Any help is apperciated
ts=1/21;
t=0:ts:1;
for k=1:lengtht(t)
th(k)=(k-1)*2*pi/(length(t)-1)
end
Thanks

답변 (1개)

KSSV
KSSV 2020년 7월 12일
편집: KSSV 2020년 7월 12일

0 개 추천

You can simply use
m = 100 ; % get this value using your ts step size
th = linspace(-pi,pi,m) ;
Using the time step ts..simply use
ts = 1/21 ;
th = -pi:ts:pi ;

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

질문:

HN
2020년 7월 12일

편집:

2020년 7월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by