How to obtain element-wise squaring of vector/matrix?
11-27-2019, 07:20 AM
Post: #5
 mbeddo Member Posts: 54 Joined: Nov 2014
RE: How to obtain element-wise squaring of vector/matrix?
(11-26-2019 11:18 PM)goetz Wrote:  Alternatively you could also use the "point" operator .^ for element wise power operator on a vector or matrix , e.g.:

Code:
[1, 2, 3, 4].^2

resulting in: [1, 4, 9, 16]

Fantastic!

It seems I still have a ways to go digesting the reference manual - these point operators didn't register while searching for element-wise operators. Guess I have a ways to go to learn how to search the documents.
 « Next Oldest | Next Newest »

 Messages In This Thread How to obtain element-wise squaring of vector/matrix? - mbeddo - 11-26-2019, 07:40 PM RE: How to obtain element-wise squaring of vector/matrix? - swagner53 - 11-26-2019, 08:47 PM RE: How to obtain element-wise squaring of vector/matrix? - mbeddo - 11-27-2019, 07:16 AM RE: How to obtain element-wise squaring of vector/matrix? - goetz - 11-26-2019, 11:18 PM RE: How to obtain element-wise squaring of vector/matrix? - mbeddo - 11-27-2019 07:20 AM

User(s) browsing this thread: 1 Guest(s)