Effacer les filtres
Effacer les filtres

add an integer x to certain values of a vector

1 vue (au cours des 30 derniers jours)
lowcalorie
lowcalorie le 23 Fév 2012
for example i have the number 8, and i have a vector[ 1 2 3 4 5]
i need to add 8 to the elements 1-4 of the vector to get the value 18
how would i do this?

Réponse acceptée

Walter Roberson
Walter Roberson le 23 Fév 2012
8 + sum(YourVector(1:4))

Plus de réponses (0)

Catégories

En savoir plus sur Elementary Math dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by