sum, vector elements, except i-th
13 ビュー (過去 30 日間)
古いコメントを表示
hi,
how can I sum vector elements, say v = rand(1,30), except 12th one?
thanks,
0 件のコメント
採用された回答
Mona
2015 年 7 月 8 日
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)
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!