From: Gerry on 30 Jan 2010 19:59 Hello, I am new in Matlab and I don't know how to add an element to the next element in my vector (i+1). I tried several loops but couldn't make them work. Here is an example: A=[2 2 2 2]; I want "B" to be: B=[2 4 6 8] My vectors are actually thousands long, so I need a method to easily create such kind of "continuous" vectors. I will really appreciate any help about this. Gerry
From: Walter Roberson on 30 Jan 2010 22:33 Gerry wrote: > I am new in Matlab and I don't know how to add an element to the next > element in my vector (i+1). cumsum()
From: Gerry on 30 Jan 2010 23:56 Walter Roberson <roberson(a)hushmail.com> wrote in message <hk2tlj$4hp$1(a)canopus.cc.umanitoba.ca>... > Gerry wrote: > > > I am new in Matlab and I don't know how to add an element to the next > > element in my vector (i+1). > > cumsum() Walter, Thanks a million!! -gerry
|
Pages: 1 Prev: Running Plot Commands on Parallel Processor Next: Urgent! problem with axes |