MATLAB Answers

What is the advantage of fliplr, flipud?

16 views (last 30 days)
Ray Lee
Ray Lee on 28 Nov 2018
Commented: Sean de Wolski on 28 Nov 2018
It's easy to flip along a dim using `end:-1:1`. So why design the builtin fliplr, flipud functions?


Sign in to comment.

Answers (1)

per isakson
per isakson on 28 Nov 2018
Edited: per isakson on 28 Nov 2018
  • higher level; easier to read and remember
  • fliplr is faster for large vectors (R2018a)

  1 Comment

Sean de Wolski
Sean de Wolski on 28 Nov 2018
  • Works long any arbitrary dimensional array:
x = rand(3,3,3,3,3);
Though flip() is now the preferred means.
  • Easier for users not fluent in indexing.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by