Excuses for this I have 2 x 4:
2 4$1 1 0 0 0 1 1 1
and for simplicity I said 4 x 4 but I want the same 8 x 4 matrix
I would consider each doubled row as one element and multiply them by the 2
x 4 one.
so each doubled row has size of 2 x 4 and the multiplier as well.
I would like to do array by array multiplication on doubled rows, so If I
have the following doubled row in the original matrix:
1  1  2  2 
1  1  2  2

what should get in the resultant matrix:
1  1   0   0
0  1   2   2

and do that for all the pairs


Henry Rich wrote:
> 
> I'm not clear about what you want.
> 
> You start with 4x4
> 
> You then double the rows to get 8x4
> 
> You then do something else, leaving 8x4 (?)
> 
> You then multiply by 4x2, leaving 8x2 (?)
> 
> Now you want to get back to 4x4?  Do you just want to run each pair of 
> rows together to make one row of the result?
> 
> If so,
> 
> _2 ,\ i. 8 2
> 
> 
> Henry Rich
> 
> 
> On 9/5/2012 6:36 PM, pascha wrote:
>>
>>
>>
>> Henry Rich wrote:
>>>
>>>
>>>
>>> On 9/5/2012 6:18 PM, pascha wrote:
>>>>
>>>> sorry for quick posts by me.. I am newbie in J
>>>> I want to solve a linear system of equation and I want to get a
>>>> desirable
>>>> design matrix for the equation
>>>> considering a simple case of 4 x 4 matrix i. 4 4:
>>>> 0  1  2  3
>>>>    4  5  6  7
>>>>    8  9 10 11
>>>> 12 13 14 15
>>>>
>>>> could you give a strategy to duplicate each row and get a 8 x 4 matrix,
>>>> e.g.
>>>> :
>>>> 0  1  2  3
>>>> 0  1  2  3
>>>>    4  5  6  7
>>>>    4  5  6  7
>>>>    8  9 10 11
>>>>    8  9 10 11
>>>> 12 13 14 15
>>>> 12 13 14 15
>>>>
>>>
>>> Just do
>>>
>>> 2 # mtx
>>>
>>>
>>>> At the end for each duplicate array I want to multiply them by another
>>>> 2
>>>> x 4
>>>> matrix (say,  1 1 0 0,. 0 1 1 1) and get the final design matrix. Is
>>>> the
>>>> solution come with the concept of boxing in this situation?
>>>>
>>>
>>> Boxing may not be needed.  Matrix multiply is
>>>
>>> +/ . *
>>>
>>> and you can just
>>>
>>> mp =: +/ . *
>>>
>>> mtx mp (1 1 0 0,. 0 1 1 1)
>>>
>>>
>>> Henry Rich
>>>
>>> Thanks
>>> well, I want to do array by array multiplication:
>>> so If I have i. 4 4 the result should be again a 4 x 4 or 4 x 8 matrix,
>>> like this:
>>> 0  1   0  0
>>> 0  5   6  7
>>> 8  9   0  0
>>> 0 13 14 15
>>>
>>> that's why I though about boxing
>>>
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/forums.htm
>>>
>>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 
> 
-- 
View this message in context: 
http://old.nabble.com/duplicate-row-of-matrix-tp34394924s24193p34395056.html
Sent from the J Programming mailing list archive at Nabble.com.

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to