Flipping a Cell Array

1 visualizzazione (ultimi 30 giorni)
Avery Krovetz
Avery Krovetz il 5 Lug 2016
Commentato: Stephen23 il 5 Lug 2016
I have an m x n cell array and I need to flip the 2:m elements vertically. Flipud doesn't seem to be working neither does flipdim(...,1). Suggestions?
Edit: I'm using R2012a.

Risposta accettata

Walter Roberson
Walter Roberson il 5 Lug 2016
NewCell = YourCell([1, m:-1:2], :);
  1 Commento
Stephen23
Stephen23 il 5 Lug 2016
Perhaps easier is to use end:
YourCell([1, end:-1:2], :)

Accedi per commentare.

Più risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 5 Lug 2016
A(2:m,:)=flipud(A(2:m,:))

Categorie

Scopri di più su Matrices and Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by