Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Combining arrays to matrix

Status
Not open for further replies.

andykol

Programmer
Jul 31, 2009
3
GB
Hello,

Currently I have two single dimension array. I am interested to know if I can modify program by combining them giving same result.
E.g. A(X), B(Y) used for M=P*A(1)+Q*B(2)
Proposed- A(X,Y) used for M=P*A(1,Y)+Q*B(X,2)
where A(1,Y)=A(1), B(X,2)=B(2)

Is it possible to do like this? if yes, the how? also whether it can reduce memory utilisation?

Thanks in advance.
 
Hi, andykol

I do not know if I understand you correctly,
but I would put A(1...n) into C(1,1...n) and B(1...n) into C(2,1...n).
And then:
M = P*C(1,y) + Q*C(2,x)
where x and y are integers of course.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top