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.
댓글 수: 0
채택된 답변
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);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Denoising and Compression에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!