How to insert a column in a cell array
88 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
David Hill
2020-2-26
Cell arrays can contain anything in there cells. Inserting a empty holder for a column vector:
b={a{1:2},[],a{3:end}}
2 个评论
F
2022-10-12
Open variable in variable editor and right click to get menu, select column to the left (or right) or whatever you want.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!