matrix to cell convert?
古いコメントを表示
i have A=4*16384 double matrix and converted into 64*64 cell and each cell have again 4*4 double matrix ,now iam trying this below code
c = mat2cell(A,4,4*ones(64,64))
but it gives error
Error using mat2cell
Input arguments, D1 through D2, should be vectors.
4 件のコメント
Geoff Hayes
2019 年 8 月 29 日
SRI - your third input is a 64x64 matrix but mat2cell is expecting this to be a vector. What dimensions of the cell matrix are you trying to get?
SRI
2019 年 8 月 29 日
Rik
2019 年 9 月 3 日
Comment sent by email:
i have rgb image and now i converted into 64*64 cell and each cell block has 8*8*3 cell blocks but i want to apply iwt to each and every individual blocks and apply reverse process and i want retrieve original cell has 64*64 cell blocks...please give the solution sir...............
Which part is your actual question? Do you want to know how to apply a function to all elements of a cell array? Do you want to know how to redivide a cell array containing matrices?
採用された回答
その他の回答 (1 件)
Bruno Luong
2019 年 8 月 29 日
編集済み: Bruno Luong
2019 年 8 月 29 日
Depending on what you want as organization, either
C = mat2cell(reshape(A,4*64,4*64),4*ones(1,64),4*ones(1,64))
or
C = reshape(mat2cell(A,4,4*ones(1,64*64)),64,64) % EDIT: This is the reverse of A = [C{:}]
or ....
7 件のコメント
SRI
2019 年 8 月 29 日
Bruno Luong
2019 年 8 月 29 日
編集済み: Bruno Luong
2019 年 8 月 29 日
Because the first command I wrote before you finally tell us (in your third comment) how A is obtained and you did not specify the order. Your original question is confusing.
SRI
2019 年 8 月 29 日
SRI
2019 年 8 月 29 日
Bruno Luong
2019 年 8 月 29 日
You accept which one is best for you.
I don't really care if my answer is not accepted as long as it is useful for you or somebody else.
Bruno Luong
2019 年 8 月 29 日
編集済み: Bruno Luong
2019 年 8 月 29 日
Why? You got your answer here, why should I post there (where the order is not specified)?
SRI
2019 年 8 月 29 日
カテゴリ
ヘルプ センター および File Exchange で Time Series Objects についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!