create a new cell array by repeating values

i have a cell array with n columns... from this n values i want to create a new cell with "r" rows and "c" columns.... that repeat the cell values that much times i specify...

 採用された回答

KSSV
KSSV 2017 年 2 月 15 日
編集済み: KSSV 2017 年 2 月 15 日

1 投票

doc repmat
r = cell(3,1) ;
r{1} = rand(10) ;
r{2} = rand(3,3) ;
r{3} = rand(5,4) ;
repamt(r,3,2)

5 件のコメント

Elysi Cochin
Elysi Cochin 2017 年 2 月 15 日
i have cell array of 1x60, i wanted to create 16 rows 54 columns, i did as
repmat(cellarr, 16, 60);
the column of output was more than i wanted... how to reduce it..
KSSV
KSSV 2017 年 2 月 15 日
r{1} = rand(1,60) ;
A = repmat(r,16,54) ;
size(A)
Elysi Cochin
Elysi Cochin 2017 年 2 月 15 日
r = 1 x 60 cell each column of the cell has 25x25 value,
now when i do
A = repmat(r, 16, 54);
i get size of A = 16x3240 with each column 25x25, but i want size of A = 16x54 with each column 25x25
KSSV
KSSV 2017 年 2 月 15 日
How about this?
clc; clear all ;
r = cell(1,60) ;
for i = 1:60
r{i} = rand(25,25) ;
end
A = repmat({r},16,54) ;
Elysi Cochin
Elysi Cochin 2017 年 2 月 15 日
sir now what we get is, each column of cell array A is a cell array
i want each column of cell array A as a matrix with size 25 x 25

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2017 年 2 月 15 日

コメント済み:

2017 年 2 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by