What is the advantage of fliplr, flipud?

19 次查看(过去 30 天)
It's easy to flip along a dim using `end:-1:1`. So why design the builtin fliplr, flipud functions?

回答(1 个)

per isakson
per isakson 2018-11-28
编辑:per isakson 2018-11-28
YMMV
  • higher level; easier to read and remember
  • fliplr is faster for large vectors (R2018a)
  1 个评论
Sean de Wolski
Sean de Wolski 2018-11-28
  • 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.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by