Prev: Separating GUI Concerns / Nesting Functions
Next: wholesale Cheap Jordans online store,Cheap Dunk,Air Force One ..paypal payment
From: James Tursa on 7 Apr 2010 09:37 "James Tursa" <aclassyguy_with_a_k_not_a_c(a)hotmail.com> wrote in message <hpi1bk$mso$1(a)fred.mathworks.com>... > > This mxArray tag was published by Peter Boettcher on a website somewhere (can't find it at the moment). You can find it here: http://www.mk.tu-berlin.de/Members/Benjamin/mex_sharedArrays The m and n size data isn't correct for multi-dimensional arrays, but that doesn't matter for your application since your data is 1D. James Tursa
From: Bruno Luong on 7 Apr 2010 09:56 "Robert" <rtaintor(a)hotmail.com> wrote in message <hpi0d5$8jv$1(a)fred.mathworks.com>... > > > So essentially you are not allowed to move the pointer of something made by a function like mxCalloc and still use mxSetPr? This implies that matlab actually keeps track of the top of the pointers it allocates I guess? > No, as James pointed out you are not allowed to do that. I had bumped into the same issue discussed in this thread: http://www.mathworks.com/matlabcentral/newsreader/view_thread/254813 As you can see, it is possible to work around by digging deep into internal mxArray structure. You can check my submission on FEX for proper implementation that can work for all Matlab version: http://www.mathworks.com/matlabcentral/fileexchange/24576-inplacearray-a-semi-pointer-package-for-matlab Bruno
From: Robert on 7 Apr 2010 14:54
Thanks guys! I tried out the solution of using the mxArray class directly and that seems to work nicely. I suspect this is still kind of a hacky solution that I'll have to fix when later versions of matlab come, but it fits my needs for now. "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hpi2u9$hv8$1(a)fred.mathworks.com>... > "Robert" <rtaintor(a)hotmail.com> wrote in message <hpi0d5$8jv$1(a)fred.mathworks.com>... > > > > > > So essentially you are not allowed to move the pointer of something made by a function like mxCalloc and still use mxSetPr? This implies that matlab actually keeps track of the top of the pointers it allocates I guess? > > > > No, as James pointed out you are not allowed to do that. I had bumped into the same issue discussed in this thread: http://www.mathworks.com/matlabcentral/newsreader/view_thread/254813 > > As you can see, it is possible to work around by digging deep into internal mxArray structure. > > You can check my submission on FEX for proper implementation that can work for all Matlab version: > http://www.mathworks.com/matlabcentral/fileexchange/24576-inplacearray-a-semi-pointer-package-for-matlab > > Bruno |