フィルターのクリア

Growing a Cell Array

20 ビュー (過去 30 日間)
Victor
Victor 2014 年 7 月 1 日
回答済み: Titus Edelhofer 2014 年 7 月 1 日
I have created a cell array of size {1,1} but what if i want to add other matrices in the array? Do i have to preallocate it or will it automatically grow as I add contents in the cell array?

採用された回答

Titus Edelhofer
Titus Edelhofer 2014 年 7 月 1 日
Hi Victor,
it will automatically grow:
x = {1}
x =
[1]
x{3} = 'Hello'
x =
[1] [] 'Hello'
Nevertheless, if the array will become large and you know the size before, preallocation, e.g. in this case
x = cell(1,3);
saves time.
Titus

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by