フィルターのクリア

How to insert a column in a cell array

74 ビュー (過去 30 日間)
Rene M
Rene M 2020 年 2 月 26 日
コメント済み: F 2022 年 10 月 12 日
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.

採用された回答

David Hill
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 件のコメント
Rene M
Rene M 2020 年 2 月 27 日
Nice, it works. thank you very much!
F
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 ExchangeShifting and Sorting Matrices についてさらに検索

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by