Asked by Andrew
on 1 Feb 2013

I have performed DCT on an image(256×256) and the the compressed data is saved in a file. When i open this file in workspace, the compressed file is a 32×32 structure, with cells, each containing binary digits of different lengths(some more than 128) for each cell. I would like to extract these digits and align them in 1 matrix, however i do not know how to do this. Can you please advise me on how to solve this problem in matlab.

*No products are associated with this question.*

Answer by José-Luis
on 1 Feb 2013

Accepted answer

I am not sure I understand your question. But if what you mean is that you have a cell array of structures and that you want to extract one element from each structure, then you could do as follows:

a.whatever = 125; %some structure your_cell = cell(10,5); your_cell(:) = {a};

your_mat = cellfun(@(x) x.whatever,your_cell);

Andrew
on 1 Feb 2013

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 0 Comments