how to reverse cell elements from left to right

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 Comment

Without defining an intermediate anonymous function:
cellfun(@fliplr,a, 'uni',0)

Sign in to comment.

 Accepted Answer

cellfun(@(x) {fliplr(x)},a)

4 Comments

I really appreciate it, Thanks alot Jose
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,,

Sign in to comment.

More Answers (0)

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!