Connecting Tech Pros Worldwide Help | Site Map

how to go from X(i,j,k) to Y((i,j),k) ?

 
LinkBack Thread Tools Search this Thread
  #1  
Old September 5th, 2006, 12:55 AM
poyraz.kayabas@gmail.com
Guest
 
Posts: n/a
Default how to go from X(i,j,k) to Y((i,j),k) ?

Hi All,

I have a 3-dimensional data set

It is a N x N x N matrix

In other words cells are X(i,j,k) for i,j,k =N

--------------
Here is my problem:

I want to create a table to represent this data. Since it is 3-dim, I
need a 2-dim matrix.
-------------

Question:

I want to make a matrix/ table for each (i,j) pair versus k

So it is going to be a 2-dim N*N x N matrix.

-----------------------------------------------
EXAMPLE: for N=2

I have this
i j k
X(1,1,1)=a
X(1,1,2)=b
X(1,2,1)=c
X(1,2,2)=d
X(2,1,1)=e
X(2,1,2)=f
X(2,2,1)=g
X(2,2,2)=k

But I need this

(i,j) k
Y((1,1),1)=a
Y((1,1),2)=b
Y((1,2),1)=c
Y((1,2),2)=d
Y((2,1),1)=e
Y((2,1),2)=f
Y((2,2),1)=g
Y((2,2),2)=k

Actually I need this

k= 1 2
(i,j)
(1,1) a b
(1,2) c d
(2,1) e f
(2,2) g k

And I have no idea about how to do this. And my N is 65 :-(

Thanks in advance.


  #2  
Old September 5th, 2006, 01:45 PM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: how to go from X(i,j,k) to Y((i,j),k) ?

poyraz.kayabas@gmail.com wrote:
Quote:
I have a 3-dimensional data set
>
It is a N x N x N matrix
>
In other words cells are X(i,j,k) for i,j,k =N
You mean, "for i,j,k =[1..N]", or in C++ "for i,j,k =[0..N-1]".
Quote:
>
--------------
Here is my problem:
>
I want to create a table to represent this data. Since it is 3-dim, I
need a 2-dim matrix.
Why? Is that a homework assignment?
Quote:
-------------
>
Question:
>
I want to make a matrix/ table for each (i,j) pair versus k
>
So it is going to be a 2-dim N*N x N matrix.
>
-----------------------------------------------
EXAMPLE: for N=2
>
I have this
i j k
X(1,1,1)=a
X(1,1,2)=b
X(1,2,1)=c
X(1,2,2)=d
X(2,1,1)=e
X(2,1,2)=f
X(2,2,1)=g
X(2,2,2)=k
>
But I need this
>
(i,j) k
Y((1,1),1)=a
Y((1,1),2)=b
Y((1,2),1)=c
Y((1,2),2)=d
Y((2,1),1)=e
Y((2,1),2)=f
Y((2,2),1)=g
Y((2,2),2)=k
>
Actually I need this
>
k= 1 2
(i,j)
(1,1) a b
(1,2) c d
(2,1) e f
(2,2) g k
>
And I have no idea about how to do this. And my N is 65 :-(
If you think that your 'i,j' pair is a two-digit N-based number, then
you should be able to calculate its value 'ij' using a simple enough
formula involving 'i', 'j', and 'N'... For example, for N==42, i==7
and j==33 it woule be 327.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.