matrix calculation

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

matrix calculation

P.van Groenestijn
Dear list,

Hi Marta,


As a result of some calculation I found this matrix, called mat:
mat
6
8
6

Could anyone help me to find a syntax that results in the following output
scalar, called res:
res
132

132 is the result of (6*8) + (6*6) + (8*6) in other words each element of
the matrix is multiplicated with each other. It would be nice when I can
also use the syntax in other examples (for example when the matrix here
called mat, has 5 elements).

Any help will be highly appreciated!!

Regards,
Pieter van Groenestijn
University of Nijmegen
Reply | Threaded
Open this post in threaded view
|

Re: matrix calculation

Marta García-Granero
Hi Pieter

Didn't you see the solution I posted?

PvG> As a result of some calculation I found this matrix, called mat:
PvG> mat
PvG> 6
PvG> 8
PvG> 6

PvG> Could anyone help me to find a syntax that results in the following output
PvG> scalar, called res:
PvG> res
PvG> 132

PvG> 132 is the result of (6*8) + (6*6) + (8*6) in other words each element of
PvG> the matrix is multiplicated with each other. It would be nice when I can
PvG> also use the syntax in other examples (for example when the matrix here
PvG> called mat, has 5 elements).

--
Regards,
Dr. Marta García-Granero,PhD           mailto:[hidden email]
Statistician