Extracting data from a structure

1 次查看(过去 30 天)
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.

采纳的回答

José-Luis
José-Luis 2013-2-1
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);
  1 个评论
Andrew
Andrew 2013-2-1
Thank you for the feedback. Just to make it more clear(sorry if i was vague), i would like to extract every digit in each of the structures so that i form one big matrix. e.g cell(1,1) contains about this (111000000110000001100000010000111000)binary digits, so i would like to extract all of them and all the other from each of the remaining cells so that i can form one big matrix of all those. My aim is to have this data being able to be read in a c++ code which inputs 256*256 image data. that is why i want to extract all these digits since the code wont function when the data is still in the structure form. Just in case, the code is here (<http://ge.tt/7q04jkV/v/1>) and the compressed data is "I_runcode" Thank you again

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Denoising and Compression 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by