Thread Subject: multidimensional matrix with different sizes

Subject: multidimensional matrix with different sizes

From: ecresna via MathKB.com

Date: 17 Jul, 2008 10:53:00

Message: 1 of 5

Hi all.

It could be possible to fill a 4D matrix with different 3D matrices?????

I'm trying to fill a 4D matrix with some 512x512xN matrices where N can be 4,
8 or 16.

/ 512x512x8 512x512x4 \
| |
\ 512x512x8 512x512x16 /


Next I need to send it to a C mex file but my mex file can just detect the
upper level (if I have a group of 4 512x512xN matrices, my Cmex file just
will detect a 2x2 matrix)

What can I do?
Thanks in advance.

--
Message posted via http://www.mathkb.com

Subject: multidimensional matrix with different sizes

From: John D'Errico

Date: 17 Jul, 2008 11:14:03

Message: 2 of 5

"ecresna via MathKB.com" <u41514@uwe> wrote in message
<874757abd8eab@uwe>...
> Hi all.
>
> It could be possible to fill a 4D matrix with different 3D matrices?????
>
> I'm trying to fill a 4D matrix with some 512x512xN matrices where N can
be 4,
> 8 or 16.
>
> / 512x512x8 512x512x4 \
> | |
> \ 512x512x8 512x512x16 /
>
>
> Next I need to send it to a C mex file but my mex file can just detect the
> upper level (if I have a group of 4 512x512xN matrices, my Cmex file just
> will detect a 2x2 matrix)
>
> What can I do?

help cell

John

Subject: multidimensional matrix with different sizes

From: ecresna via MathKB.com

Date: 17 Jul, 2008 12:16:42

Message: 3 of 5

Fine.

Thanks John. But I have yet a cell like this:

/ 512x512x8 512x512x4 \

| |
\ 512x512x8 512x512x16 /

My problem is I want to send it to a Cmex program which just can
"read/detect" the first level (2x2 matrix) and I cannot put these all
matrices in a big one (by using cell2mat )because of dimensions.

Thanks.

--
Message posted via MathKB.com
http://www.mathkb.com/Uwe/Forums.aspx/matlab/200807/1

Subject: multidimensional matrix with different sizes

From: Peter Boettcher

Date: 17 Jul, 2008 16:35:05

Message: 4 of 5

"ecresna via MathKB.com" <u41514@uwe> writes:

> Fine.
>
> Thanks John. But I have yet a cell like this:
>
> / 512x512x8 512x512x4 \
>
> | |
> \ 512x512x8 512x512x16 /
>
> My problem is I want to send it to a Cmex program which just can
> "read/detect" the first level (2x2 matrix) and I cannot put these all
> matrices in a big one (by using cell2mat )because of dimensions.

You need to write your MEX code to expect a cell array, and pull out the
pointers to the other matrices underneath. See the MEX documentation
for cell arrays.

-Peter

Subject: multidimensional matrix with different sizes

From: ecresna via MathKB.com

Date: 18 Jul, 2008 06:43:04

Message: 5 of 5

Peter Boettcher wrote:
>> Fine.
>>
>[quoted text clipped - 8 lines]
>> "read/detect" the first level (2x2 matrix) and I cannot put these all
>> matrices in a big one (by using cell2mat )because of dimensions.
>
>You need to write your MEX code to expect a cell array, and pull out the
>pointers to the other matrices underneath. See the MEX documentation
>for cell arrays.
>
>-Peter


Thank you!!!

I hope I shouldn't modify my mex code and just changing some matlab code I
could get these matrices, but.....

Well, thank you very much!!!

--
Message posted via http://www.mathkb.com

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com