フィルターのクリア

Convert cell (each entry is a 3D matrix) to 4D matrix

1 回表示 (過去 30 日間)
RuiQi
RuiQi 2016 年 6 月 30 日
編集済み: José-Luis 2016 年 6 月 30 日
I have a cell array of size ( 1 x 80000 ). In each of the cell I have a 3D matrix (an image). How do I convert the cell array to a 4D matrix such that matrix(:,:,:,1) represents image number 1 ? I have a code for it below but I made use of the for loop. I was wondering if there's a neater alternative to it.
negative_samples_2 = zeros(32, 32, 4, size(hard_negatives,2));
for i = 1:size(hard_negatives,2),negative_samples_2(:,:,:,i) = hard_negatives{i};end

回答 (1 件)

José-Luis
José-Luis 2016 年 6 月 30 日
編集済み: José-Luis 2016 年 6 月 30 日
your_result = cat(4, your_cell_array{:});

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by