convert cell array to tiff?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have pre-processed my netcdf file to extract a specific variable (global CO2 coverage). however the result is a cell array of 1 row and 31 columns and each column is a 97*96 matrix but i need to convert this to a tiff file and i have no idea how to accomplish this. i have attached the matlab script which i have used so far to help understanding, the netcdf file itself is >300mb but a link to onedrive is provided.
appreciate the help.
댓글 수: 0
답변 (1개)
Vandana Rajan
2016년 8월 8일
Hi,
If we assume that the size of the tiff file you need is a 97 X 2976 (97*96 = 2976), then first convert the cell to a matrix and then make a tiff file using the imwrite function.
%%creating a random cell array
c = cell(1,31);
for i = 1:31
c{1,i} = rand(97,96);
end
%%converting cell to matrix first and writing the matrix to a .tiff file
m = cell2mat(c);
imwrite(m,'out.tiff');
im = imread('out.tiff');
imshow(im);
This code will result in an image of size 97 X 2976
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 NetCDF에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!