How can I convert a 3D kxmxn matrix into n images directly?

1 回表示 (過去 30 日間)
Rogier Brand
Rogier Brand 2016 年 8 月 26 日
回答済み: Azzi Abdelmalek 2016 年 8 月 26 日
I have several 3D matrices (representing spectral maps) with kxm being the 2D dimensions and the spectra along the n direction.
What I need to do for further processing is dividing the matrix into n kxm images and save them as tif. Would anyone know how to attack this problem and preferably avoid for loops?
It is probably an arbitrary problem, but being not a Matlab expert nor being able to find good code for it on the net, I wanted to drop the question here. Many thanks in advance.

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 8 月 26 日
for k=1:n
Im=M (:,:, k)
imwrite (Im,sprintf ('file% d', k))
end

カテゴリ

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