Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using the 'stack' function to combine an unknown number of matrices

Status
Not open for further replies.

Scrat

Computer
Aug 4, 2007
1
Hi there, I've written a program which reads in a data table from MS Access and displays these values in a matrix then does a whole load of stuff and produces a separate data table for each of the values which have been read in (using the Rkadapt function). These tables have been labelled Z[0, Z[1, Z[2 etc where the subscript number pertains to the position of the relevant value in the initial matrix. The problem i'm having is that I need the program to work for an unknown number of values read into the initial matrix, and therefore an unknown number of Z[n matrices. The whole program has been engineered to do this apart from the following command:

X:=stack(Z[0,Z[1,Z[2)

It seems to me that there is no way of modifying this code so that an unknown number of Z matrices could automatically be evaluated by the stack command, i.e. If 70 Z matrices were required because 70 values were read into the initial matrix, the above code would have to be changed MANUALLY to stack all 70 together. I've tried everything I can think of to make the program do this for me and nothing seems to work! If anyone could help with this I would be so grateful!

Natalie
 
Replies continue below

Recommended for you

I don't understand. If you've got a program, why do you need to stack all the matrices at once? Why can't you loop on the stacking each matrix to the resultant from the previous stacking?

TTFN

FAQ731-376
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor