[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: vectorization problem
From: |
Schirmacher, Rolf |
Subject: |
RE: vectorization problem |
Date: |
Wed, 30 Mar 2011 19:02:23 +0200 |
diff(a) ./ a(1:end-1) ?
Untested...
Regards,
Rolf
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden Behalf Of dirac
> Sent: Wednesday, March 30, 2011 6:53 PM
> To: address@hidden
> Subject: vectorization problem
>
>
> Hi again,
>
> I am trying to do a really simple calculation where I have
> some vector 'a'
> say. All I want to do is to find:
>
> b = [a(i)-a(i+1)]/a(i)
>
> Is there a way to do this by vector multiplication rather
> than for loops? I
> can't see a way to do it because the new vector will be 1
> element less than
> the original vector 'a'.
>
> Thanks
>
> -----
> Still learning everyday.
> --
> View this message in context:
> http://octave.1599824.n4.nabble.com/vectorization-problem-tp34
> 18677p3418677.html
> Sent from the Octave - General mailing list archive at Nabble.com.
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>