Borrar filtros
Borrar filtros

How to insert a column in a cell array

74 visualizaciones (últimos 30 días)
Rene M
Rene M el 26 de Feb. de 2020
Comentada: F el 12 de Oct. de 2022
Hello everyone,
I am trying to insert a new empty column inside a cell array between two existing columns without deleting one of them. I basically want to perform the task ('Insert column to the left') shown in the picture below by code:
I hope someone can help me with this.
Thanks in advance.

Respuesta aceptada

David Hill
David Hill el 26 de Feb. de 2020
Cell arrays can contain anything in there cells. Inserting a empty holder for a column vector:
b={a{1:2},[],a{3:end}}
  2 comentarios
Rene M
Rene M el 27 de Feb. de 2020
Nice, it works. thank you very much!
F
F el 12 de Oct. de 2022
Open variable in variable editor and right click to get menu, select column to the left (or right) or whatever you want.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Shifting and Sorting Matrices en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by