Flip order of a vector

How can I reorder a vector. In Matlab there is a command (flip) that does the job, is there an equivalent in Gauss? I'd like to flip a vector, but I can't find any command for this.

2 Answers



1



accepted

You can use the rev function in GAUSS to reverse the rows of a vector, matrix or dataframe.

x = { 1, 2, 3, 4 };

x_rev = rev(x); 

after the above code:

x = 1
    2
    3
    4

x_rev = 4
        3
        2
        1

aptech

1,773


0



Perfect, this is what I am looking for. Thanks!

Your Answer

2 Answers

1
accepted

You can use the rev function in GAUSS to reverse the rows of a vector, matrix or dataframe.

x = { 1, 2, 3, 4 };

x_rev = rev(x); 

after the above code:

x = 1
    2
    3
    4

x_rev = 4
        3
        2
        1

0

Perfect, this is what I am looking for. Thanks!


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.