How to add columns to cell array

6 Ansichten (letzte 30 Tage)
Neville
Neville am 22 Okt. 2013
Kommentiert: Neville am 22 Okt. 2013
I have this cell array:
cells =
'a' 'b' 'c'
'd' 'e' 'f'
'g' 'h' 'i'
What I want to do is add 2 columns with '-' in them.
cells =
'a' 'b' 'c' '-' '-'
'd' 'e' 'f' '-' '-'
'g' 'h' 'i' '-' '-'
Is it possible to do it dynamically depending on the number of rows?

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 22 Okt. 2013
[cells repmat({'-'},3,2)]

Weitere Antworten (0)

Kategorien

Mehr zu Data Types finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by