How to flip the individual elements in an array

3 ビュー (過去 30 日間)
Hari
Hari 2016 年 11 月 17 日
コメント済み: Hari 2016 年 11 月 17 日
I have a 3 x 1 cell array:
[1,2,5]
[1,2,4,5]
[1,2,3,6,15,7]
Is there a way to form a new cell array which includes these elements as well as their flipped ones,like this:
[1,2,5]
[1,2,4,5]
[1,2,3,6,15,7]
[5,2,1]
[5,4,2,1]
[7,15,6,3,2,1]

採用された回答

KSSV
KSSV 2016 年 11 月 17 日
編集済み: KSSV 2016 年 11 月 17 日
doc fliplr
c = {[1,2,5]
[1,2,4,5]
[1,2,3,6,15,7]} ;
% reverse the arrays
c1 = cellfun(@fliplr,c,'un',0) ;
iwant = [c ; c1] ;
  1 件のコメント
Hari
Hari 2016 年 11 月 17 日
Thank you!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by