473,378 Members | 1,594 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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.

Sep 5 '06 #1
1 1476
po************@gmail.com wrote:
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]".
>
--------------
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?
-------------

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
Sep 5 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: John | last post by:
Hello. I am currently working through a book on Dreamweaver and using PHP. I am having a little trouble with setting up the database though. I have php 4.2.3 and MySQL 4.0.20a. I am running...
7
by: James Johnson | last post by:
Are there structs in JavaScript? If not, what's the closest thing, or do I just use parallel arrays? I'm populating a JavaScript array from ColdFusion query, but I don't think I can do this: ...
5
by: kux | last post by:
Hello everyone, I hope someone is out here who can help me with a simple calculation... I have a sales data base in access with monthly sales history by product. to make future predictions I...
10
by: MikeR | last post by:
Anyone know a group to submit a CDONTS question to? Thanks, Mike
13
by: Mumia W. | last post by:
Hello all. I have a C++ program that can count the YOYOs that are in a grid of Y's and O's. For example, this Y O Y O O Y O Y O Y O O Y O Y Y O Y O Y O O Y O O Y Y O Y O
6
by: Active8 | last post by:
Hi: This prob "magically" stopped and I'm not sure if I can recreate it, but thought I'd share it and maybe learn something. #include "stdafx.h" #include <stdlib.h> #include <math.h>...
2
by: arslanburney | last post by:
Is there anyway one could find ot the point of intersection between any two plotted functions and also display them using gnuplot.py??
1
by: pereges | last post by:
#include <stdio.h> #include <math.h> #include <stdlib.h> int main(void) { unsigned long int numpoints; printf("Enter num of points\n"); scanf("%lu", &numpoints); unsigned long int...
87
by: pereges | last post by:
I have a C program which I created on Windows machine. I have compiled and executed the program on windows machine and it gives me the consistent output every time i run it. for eg. input a = 2,...
17
by: handique | last post by:
Hi, I have javascript code for rotating images, but the rotation starts only when mouse is placed over the image. But i want to rotate images automatically when the page loads. Can any guide me in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.