Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to pass cell of 3D matrices to C mex
Date: Mon, 24 Aug 2009 10:12:04 +0000 (UTC)
Organization: Boeing
Lines: 8
Message-ID: <h6tp1k$sja$1@fred.mathworks.com>
References: <h6tl9j$a0p$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1251108724 29290 172.30.248.37 (24 Aug 2009 10:12:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 24 Aug 2009 10:12:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 756104
Xref: news.mathworks.com comp.soft-sys.matlab:565519


"oruganti murthy" <omurthy@yahoo.com> wrote in message <h6tl9j$a0p$1@fred.mathworks.com>...
> 
> I have a 1x30 cell. Each element in it consists of a MxNx3 matrix(image).
> How can I send it into C mex file in similar format, but not read only.(duplicate will not work).

Pass it in like any other variable. Then prhs[0] will be the cell array. If you want to modify it, use mxDuplicateArray to create a deep copy. Then use mxGetCell followed by mxGetPr to get at the cells and the arrays contained in the cells respectively. Why did you write that "duplicate will not work"?

James Tursa