What is the advantage of fliplr, flipud?

18 visualizaciones (últimos 30 días)
Ray Lee
Ray Lee el 28 de Nov. de 2018
Comentada: Sean de Wolski el 28 de Nov. de 2018
It's easy to flip along a dim using `end:-1:1`. So why design the builtin fliplr, flipud functions?

Respuestas (1)

per isakson
per isakson el 28 de Nov. de 2018
Editada: per isakson el 28 de Nov. de 2018
YMMV
  • higher level; easier to read and remember
  • fliplr is faster for large vectors (R2018a)
  1 comentario
Sean de Wolski
Sean de Wolski el 28 de Nov. de 2018
  • Works long any arbitrary dimensional array:
x = rand(3,3,3,3,3);
flipud(x)
Though flip() is now the preferred means.
  • Easier for users not fluent in indexing.

Iniciar sesión para comentar.

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by