Path: news.mathworks.com!not-for-mail
From: "Sadik " <sadik.hava@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: creating rgb image using pixels values
Date: Sun, 30 Dec 2012 01:56:07 +0000 (UTC)
Organization: University of North Carolina
Lines: 13
Message-ID: <kbo6vn$2jk$1@newscl01ah.mathworks.com>
References: <kbn609$gvt$1@newscl01ah.mathworks.com>
Reply-To: "Sadik " <sadik.hava@gmail.com>
NNTP-Posting-Host: www-04-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1356832567 2676 172.30.248.35 (30 Dec 2012 01:56:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 30 Dec 2012 01:56:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1666517
Xref: news.mathworks.com comp.soft-sys.matlab:785593

Hi Shobana,

How about the following:

% Assuming you have three matrices R, G and B
I = uint8(zeros([size(R) 3]));
I(:,:,1) = R;
I(:,:,2) = G;
I(:,:,3) = B;

imwrite(I,'Combined.png');

Best.