How to add columns to cell array

6 visualizzazioni (ultimi 30 giorni)
Neville
Neville il 22 Ott 2013
Commentato: Neville il 22 Ott 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?

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 22 Ott 2013
[cells repmat({'-'},3,2)]

Più risposte (0)

Categorie

Scopri di più su Data Types in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by