|
|
element-by-element multiplication
Dear Mathwork users,
If i have two matrices,
A=magic(3)
B=magic(3)
a =[8 1 6; 3 5 7; 4 9 2]
a =
8 1 6
3 5 7
4 9 2
b =[8 1 6; 3 5 7; 4 9 2]
b =
8 1 6
3 5 7
4 9 2
What multiplication method do i use (e.g. cross/dot product) if i want to multiply each element by each element to result in a 3x3 matrix to get:
c= [54, 1 36; 9 25 49; 16 81 4]
c =
54 1 36
9 25 49
16 81 4
Thank you ^^
Natalie
|
|
0
|
|
|
|
Reply
|
Natalie
|
6/19/2010 6:19:05 PM |
|
magic(3).*magic(3)
|
|
0
|
|
|
|
Reply
|
Matt
|
6/19/2010 6:27:05 PM
|
|
Also, you really should get used to using MATLAB's help facilities. For example, if you had done:
docsearch('element-by-element')
you would have figured it out!
|
|
0
|
|
|
|
Reply
|
Matt
|
6/19/2010 6:30:22 PM
|
|
"Natalie Sin Hwee " <sin.ng09@imperial.ac.uk> wrote in message <hvj1mp$p54$1@fred.mathworks.com>...
> Dear Mathwork users,
>
> If i have two matrices,
>
> A=magic(3)
> B=magic(3)
>
>
> a =[8 1 6; 3 5 7; 4 9 2]
> a =
> 8 1 6
> 3 5 7
> 4 9 2
>
> b =[8 1 6; 3 5 7; 4 9 2]
> b =
> 8 1 6
> 3 5 7
> 4 9 2
>
> What multiplication method do i use (e.g. cross/dot product) if i want to multiply each element by each element to result in a 3x3 matrix to get:
>
> c= [54, 1 36; 9 25 49; 16 81 4]
> c =
> 54 1 36
> 9 25 49
> 16 81 4
>
>
> Thank you ^^
> Natalie
Well, I don't know of ANY operator that will give you the
result you show, since 8*8 = 64, not 54.
If perhaps you really meant 64 there, then you might find
the .* operator of value.
help times
John
|
|
0
|
|
|
|
Reply
|
John
|
6/19/2010 6:30:22 PM
|
|
a.*b
and 8 x 8 is 64
"Natalie Sin Hwee " <sin.ng09@imperial.ac.uk> skrev i meddelelsen
news:hvj1mp$p54$1@fred.mathworks.com...
> Dear Mathwork users,
>
> If i have two matrices,
>
> A=magic(3)
> B=magic(3)
>
>
> a =[8 1 6; 3 5 7; 4 9 2]
> a =
> 8 1 6
> 3 5 7
> 4 9 2
>
> b =[8 1 6; 3 5 7; 4 9 2]
> b =
> 8 1 6
> 3 5 7
> 4 9 2
>
> What multiplication method do i use (e.g. cross/dot product) if i want to
> multiply each element by each element to result in a 3x3 matrix to get:
>
> c= [54, 1 36; 9 25 49; 16 81 4]
> c =
> 54 1 36
> 9 25 49
> 16 81 4
>
>
> Thank you ^^
> Natalie
|
|
0
|
|
|
|
Reply
|
John
|
6/19/2010 6:59:46 PM
|
|
|
4 Replies
299 Views
(page loaded in 0.243 seconds)
Similiar Articles: element-by-element multiplication - comp.soft-sys.matlab ...Dear Mathwork users, If i have two matrices, A=magic(3) B=magic(3) a =[8 1 6; 3 5 7; 4 9 2] a = 8 1 6 3 5 7 ... Matrix element to Matrix element-range mutiplication - comp.soft ...Greetings to you all! I have two matrices: Matrix_W=[P,N] Matrix_X=[4*P,N] I want to perform a multiplication between the [i,j]-th elements of... Changing multiple matrix element at one time - comp.soft-sys ...element-by-element multiplication - comp.soft-sys.matlab ... Changing multiple matrix element at one time - comp.soft-sys ... Hey, I'm trying to modify multiple matrix's ... extracting elements from a cell array - comp.soft-sys.matlab ...Hi, I have a large cell array of times: '08:30:01' '08:30:02' etc... I'd like to convert the times above to seconds. To do this I loop through each element ... Multiplying two int32 numbers - comp.dspelement-by-element multiplication - comp.soft-sys.matlab ... Multiplying two int32 numbers - comp.dsp element-by-element multiplication - comp.soft-sys.matlab ... Signed multiplication - comp.lang.vhdlelement-by-element multiplication - comp.soft-sys.matlab ... Signed multiplication - comp.lang.vhdl Multiplication, at it's heart, is nothing more than a sum of all of the ... RGB to YIQ using matix (code optimization) - comp.soft-sys.matlab ...element-by-element multiplication - comp.soft-sys.matlab ... RGB to YIQ using matix (code optimization) - comp.soft-sys.matlab ... element-by-element multiplication - comp ... Visible image watermarking dct domailn - comp.soft-sys.matlab ...> > Thank u ! > > see code i had written , now i want to use chaotic logistic map with secret key > and then element by element multiplication on my image which divide into ... matrix multiplication - comp.graphics.api.openglelement-by-element multiplication - comp.soft-sys.matlab ... Hey, I'm trying to modify multiple matrix's elements at a time. considering the ... Matrix multiplication ... how to use xlswrite for image files ? - comp.soft-sys.matlab ...It's the difference between doing a matrix multiply (row of one times the column of the other) and a regular element for element multiplication ( the (i,j)th element of ... Element-By-Element Multiplication - O-Matrix: High Performance ...Description Element-by-element multiplication of two values that are integer, real, double-precision, or complex. (One, but not both, of the values may be logical.) Element New York Times Square West | Official Website | Best Rates ...New York in a Natural Light. Created to be an oasis of natural light, experience a new kind of hotel in Element New York Times Square West. Our eco-friendly New York ... 7/22/2012 6:08:43 PM
|
|
|
|
|
|
|
|
|