I need to store each block's result in cell, i am using blockproc.How to do it in matlab?
1 回表示 (過去 30 日間)
古いコメントを表示
kaavya subramani
2015 年 8 月 1 日
コメント済み: kaavya subramani
2015 年 8 月 1 日
uxor=blockproc(kk,[8 8],@feature_xor, 'padpartialblocks', true);
function:
function uxor = feature_xor(block_struct)
block = block_struct.data;
ur = unique(block(1:end-1) | block(2:end), 'rows');
uxor = mod(sum(ur,1),2);
end
in want to store "uxor" result of each block in separate cell
0 件のコメント
採用された回答
Walter Roberson
2015 年 8 月 1 日
[rows,cols] = size(uxor);
uxor_cell = mat2cell(uxor, ones(1,rows), 8 * ones(1, cols/8));
6 件のコメント
Walter Roberson
2015 年 8 月 1 日
The mat2cell() will create the cell of results you originally asked for. The blockproc() you already have stores all the results in one numeric array together.
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!