how to reverse cell elements from left to right

1 visualización (últimos 30 días)
skysky2000
skysky2000 el 4 de Jul. de 2017
Comentada: Stephen23 el 5 de Jul. de 2017
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 comentario
Stephen23
Stephen23 el 5 de Jul. de 2017
Without defining an intermediate anonymous function:
cellfun(@fliplr,a, 'uni',0)

Iniciar sesión para comentar.

Respuesta aceptada

José-Luis
José-Luis el 4 de Jul. de 2017
cellfun(@(x) {fliplr(x)},a)
  4 comentarios
skysky2000
skysky2000 el 4 de Jul. de 2017
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 el 5 de Jul. de 2017
mat2cell()

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by