how to reverse cell elements from left to right

조회 수: 1 (최근 30일)
skysky2000
skysky2000 2017년 7월 4일
댓글: Stephen23 2017년 7월 5일
Dear all, I have a={[1 33 4 5] [77 8 2] [1 5]} , how to reverse the elements inside the cell. expect answer is: b= {[5 4 33 1] [2 8 77] [5 1]}
Thanks
  댓글 수: 1
Stephen23
Stephen23 2017년 7월 5일
Without defining an intermediate anonymous function:
cellfun(@fliplr,a, 'uni',0)

댓글을 달려면 로그인하십시오.

채택된 답변

José-Luis
José-Luis 2017년 7월 4일
cellfun(@(x) {fliplr(x)},a)
  댓글 수: 4
skysky2000
skysky2000 2017년 7월 4일
please jose, it shows me this message error expected to be a cell array, was double instead. when I convert d from double to cell with d= num2cell(d); didnt work,
I woundering if there is another way to reverse elements inside cell.
Thanks,,
José-Luis
José-Luis 2017년 7월 5일
mat2cell()

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by