X1=cumsum(X);
increase value in vector
1 次查看(过去 30 天)
显示 更早的评论
X=[102 103 116 145 108] %
iwant=[102 205 321 466 574] % what i need to get
% 102+103=205 ; 205+116=321 ;
for i=1:length(n)-1 % I tried to make such an option, but it does not work
X1(i)=X(i)+X(i+1)
end
Help, how can I do this better?
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Biological and Health Sciences 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!