What is the advantage of fliplr, flipud?

조회 수: 11 (최근 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 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