フィルターのクリア

Assign cell elements from a cell array to another cell array

31 ビュー (過去 30 日間)
chanukya
chanukya 2013 年 4 月 27 日
Hi, I have a cell array of size {1x85}. I would like to replace few elements in the first cell array by elements from another cell array. I tried something like a{1}{1:13} = b; b is a cell array of size 13*1 It is giving me '??? The right hand side of this assignment has too few values to satisfy the left hand side.' can some one please help Thanks

採用された回答

Cedric
Cedric 2013 年 4 月 27 日
編集済み: Cedric 2013 年 4 月 27 日
Curly brackets mean "content of" (and generate a comma-separated list when you use them with a range); they don't perform block indexing. If C is a large cell array and D a smaller one with 13 elements, you can replace the block of cells 20 to 32 in C with B as follows:
C(20:32) = D
  1 件のコメント
chanukya
chanukya 2013 年 4 月 27 日
C is a large array of cells. It has 1*85 cells in it. I would like to access each cell array and then replace few words in the particular cell array. With what you said it will just replace entire cells from C.

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

その他の回答 (1 件)

chanukya
chanukya 2013 年 4 月 27 日
A{1}(1:10) = B works good.

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by