sum, vector elements, except i-th
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
mehrdad asadi
am 8 Jul. 2015
Kommentiert: mehrdad asadi
am 8 Jul. 2015
hi,
how can I sum vector elements, say v = rand(1,30), except 12th one?
thanks,
0 Kommentare
Akzeptierte Antwort
Mona
am 8 Jul. 2015
You can always do the sum, then subtract that single element, 12th, from the sum.
v = rand(1,30);
sum_except12=sum(v)-v(12)
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!