Sample a not uniform time vector to get values from dependent variable

1 回表示 (過去 30 日間)
Jose Pachón
Jose Pachón 2020 年 5 月 8 日
編集済み: Walter Roberson 2020 年 5 月 8 日
I have imported a signal from PSpice and I need to sample that signal at a fixed frequency. The time vector doesn't have uniform sample intervals so I can´t get equal-separated values from the signal.
t=[0.001145 0.001456 0.0018123 0.00221234 0.00242345 0.0026567 0.0028904 0.0032345 0.0034567 0.0035678 0.0044567 0.0047890 0.0055677 ...]
s=[1 2 3 4 5 6 7 8 9 10 11 12 13 ...]
Ts=0.002
I would need the values from s related to 0.002 , 0.004 , 0.006 , 0.008 , 0.01....., If I round time vector I'd get multiple values (for 0.002 i would obtain 4 values but i need just 1) and I can´t index s vector.

採用された回答

Walter Roberson
Walter Roberson 2020 年 5 月 8 日
編集済み: Walter Roberson 2020 年 5 月 8 日
interp1(t,is,0.002:.002:max(t))

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpecialized Power Systems についてさらに検索

製品


リリース

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by