How to flip the individual elements in an array

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]

 Akzeptierte Antwort

KSSV
KSSV am 17 Nov. 2016
Bearbeitet: KSSV am 17 Nov. 2016

0 Stimmen

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] ;

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 17 Nov. 2016

Kommentiert:

am 17 Nov. 2016

Community Treasure Hunt

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

Start Hunting!

Translated by