normalize the vector by taking the difference from the first element

1 回表示 (過去 30 日間)
alpedhuez
alpedhuez 2021 年 7 月 28 日
コメント済み: alpedhuez 2021 年 7 月 28 日
Suppose I have a vector
T
1
2
3
Then I want to normallize T by taking the difference from the first element
T1
0 (=1-1)
1 (=2-1)
2 (=3-1)
How can I simplify the calculation?
  2 件のコメント
dpb
dpb 2021 年 7 月 28 日
編集済み: dpb 2021 年 7 月 28 日
Did you try
T=T-T(1);
alpedhuez
alpedhuez 2021 年 7 月 28 日
Thank you.

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

採用された回答

Chunru
Chunru 2021 年 7 月 28 日
T = [1; 2; 3];
T1 = T -T(1)
T1 = 3×1
0 1 2

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by