フィルターのクリア

Resetting a Time vector to zero

2 ビュー (過去 30 日間)
T
T 2013 年 3 月 25 日
suppose I have the following time vector
x = [ 4 5 6 7 8 9 10 ]
I want it reset the vector to zero so I could use:
stepsize = x(2)-x(1)
newx = [ 0:stepsize:length(x)-1]
output:
0 1 2 3 4 5 6
Is there a faster way or more efficient way to do this in matlab?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 25 日
編集済み: Azzi Abdelmalek 2013 年 3 月 25 日
  1 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 3 月 25 日
x = [ 4.5 5.7 7.7 8.9 9.8 10.1 ]
newx=x-x(1)
newx =
0 1.2000 3.2000 4.4000 5.3000 5.6000

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by