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 件のコメント

Stephen23
Stephen23 2017 年 7 月 5 日
Without defining an intermediate anonymous function:
cellfun(@fliplr,a, 'uni',0)

サインインしてコメントする。

 採用された回答

José-Luis
José-Luis 2017 年 7 月 4 日

0 投票

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

4 件のコメント

skysky2000
skysky2000 2017 年 7 月 4 日
I really appreciate it, Thanks alot Jose
José-Luis
José-Luis 2017 年 7 月 4 日
My pleasure.
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 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by