How to add columns to cell array

2 ビュー (過去 30 日間)
Neville
Neville 2013 年 10 月 22 日
コメント済み: Neville 2013 年 10 月 22 日
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?

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 22 日
[cells repmat({'-'},3,2)]
  1 件のコメント
Neville
Neville 2013 年 10 月 22 日
Wow it works. Thanks Azzi.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by