Refecting Elements of an Array - MATLAB

edited March 2012 in Science & Tech
I need to write a MATLAB function performing a symmetrical reflection of an array, so for the initial array [1 2 5 7 9], a symmetrical reflection should give [9 7 5 2 1]. Without using the built-in functions like fliplr or flipdem.
I have already done this recursively, however now need to write a code to do the same thing but non-recursively. I am unsure whether doing it non-recursively would actually require a function or not.

Any help would be great!

Comments

  • shwaipshwaip bluffin' with my muffin Icrontian
    newinds = length(array):-1:1;
    flipped = array(newinds);
Sign In or Register to comment.