Interpolating the data given between -pi and pi

2 ビュー (過去 30 日間)
HN
HN 2020 年 7 月 12 日
編集済み: KSSV 2020 年 7 月 12 日
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 日
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 ;

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by