Post Reply 
How to obtain element-wise squaring of vector/matrix?
11-27-2019, 07:20 AM
Post: #5
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
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)