What is the advantage of fliplr, flipud?

19 vues (au cours des 30 derniers jours)
Ray Lee
Ray Lee le 28 Nov 2018
Commenté : Sean de Wolski le 28 Nov 2018
It's easy to flip along a dim using `end:-1:1`. So why design the builtin fliplr, flipud functions?

Réponses (1)

per isakson
per isakson le 28 Nov 2018
Modifié(e) : per isakson le 28 Nov 2018
YMMV
  • higher level; easier to read and remember
  • fliplr is faster for large vectors (R2018a)
  1 commentaire
Sean de Wolski
Sean de Wolski le 28 Nov 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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by