필터 지우기
필터 지우기

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 CenterFile Exchange에서 Shifting 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