What is the advantage of fliplr, flipud?

19 ビュー (過去 30 日間)
Ray Lee
Ray Lee 2018 年 11 月 28 日
コメント済み: Sean de Wolski 2018 年 11 月 28 日
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 Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by