"Invert" vector
"Invert" vector
(OP)
Hi
How do I automatically invert a vector
Say that I have someting like: [4 5 6 8 56 -2] and want it to change places into [-2 56 8 6 5 4] ??
Is there a ready function for this+ i have tried programming it without good results so far. The programs I am trying to do won't let me put a vector as output...
Thanks for any help!
How do I automatically invert a vector
Say that I have someting like: [4 5 6 8 56 -2] and want it to change places into [-2 56 8 6 5 4] ??
Is there a ready function for this+ i have tried programming it without good results so far. The programs I am trying to do won't let me put a vector as output...
Thanks for any help!





RE: "Invert" vector
something like
i:1;6
b[i:0
b[(6-i):a[i
will work perfectly and can easily be mod'd
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: "Invert" vector
Thanks!
RE: "Invert" vector
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: "Invert" vector
If you want a programmed version, the following program should work
Reverse(v):= n<-last(v)
for k element-of 0..n
|w[(n-k)<-v[k
w