View previous topic :: View next topic 
Author 
Message 
camaptrang
Joined: 28 May 2013 Posts: 19

Posted: Tue Jun 11, 2013 3:15 am Post subject: Matrix outpout 


Hi all,
I have a problem. The result that i want to obtain is a matrix 2x2(note C). The parameter that i give to calculate the matrix C are a(n),b(n). So I want to obtains n matrix. What is the idea to do i?
Thank of avance 

Back to top 


mkcolg
Joined: 30 Jun 2004 Posts: 6691 Location: The Portland Group Inc.

Posted: Tue Jun 11, 2013 1:51 pm Post subject: 


Hi camaptrang,
Sorry but I'm not quite sure what you're asking. Are "a" and "b" linearized 2D arrays where n=2 (2x2)? If so, then just take the normal matrix multiply algorithm and instead of accessing using a[i][j], use a computed index "idx=i*2+j".
 Mat 

Back to top 


camaptrang
Joined: 28 May 2013 Posts: 19

Posted: Wed Jun 12, 2013 12:38 am Post subject: Matrix outpout 


Hi,
I'm sorry, I ased a question not clear. Example, I have n couple (a(i),b(i)),i=1,n. I want to calcul matrix A(mxk) n time. Example, at 1th step, i have
A(i,j)=a(1)^i*b(1)^j; i=1,...,m;j=1,...,n
.
.
.
at nth step, i have
A(i,j)=a(n)^i*b(n)^j; i=1,...,m;j=1,...,n
The results which I want to obtains are n matrix A(mxk)
Thank you of avance. 

Back to top 


mecej4
Joined: 19 Jun 2011 Posts: 62

Posted: Wed Jun 12, 2013 3:59 am Post subject: Re: Matrix outpout 


camaptrang wrote:  Hi,
...I have n couple (a(i),b(i)),i=1,n. I want to calcul matrix A(mxk) n time.
A(i,j)=a(1)^i*b(1)^j; i=1,...,m;j=1,...,n
.
.
A(i,j)=a(n)^i*b(n)^j; i=1,...,m;j=1,...,n
The results which I want to obtains are n matrix A(mxk)

What is k? There is no occurrence of k in the definitions of A(i,j) that you gave. Given that i=1:m and j=1:n, according to the definitions A is m x n, not m x k, unless k=n.
I am reminded of what one of my mathematics teachers used to drill into his students: "A problem well defined is a problem half solved". 

Back to top 


camaptrang
Joined: 28 May 2013 Posts: 19

Posted: Wed Jun 12, 2013 6:19 am Post subject: Matrix outpout 


Hi,
A is a matrix of size mxk, then j=1,..,k. I had a mistake.
Thank you. 

Back to top 




You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum

Powered by phpBB © phpBB Group
