normalize the vector by taking the difference from the first element

1 vue (au cours des 30 derniers jours)
alpedhuez
alpedhuez le 28 Juil 2021
Commenté : alpedhuez le 28 Juil 2021
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 commentaires
dpb
dpb le 28 Juil 2021
Modifié(e) : dpb le 28 Juil 2021
Did you try
T=T-T(1);
alpedhuez
alpedhuez le 28 Juil 2021
Thank you.

Connectez-vous pour commenter.

Réponse acceptée

Chunru
Chunru le 28 Juil 2021
T = [1; 2; 3];
T1 = T -T(1)
T1 = 3×1
0 1 2

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by