element-wise matrix operations

element-wise matrix operations - Сообщения

#1 Опубликовано: 21.10.2010 21:20:56
iveyj1

iveyj1

0 сообщений из 2 понравились пользователям.

Группа: User

Folks,
Is there a way to cause matrix operations to be performed
element by element? For example if two matrices are
multiplied, the top-left element of the multiplicand
would be multiplied by the top-left element of the multiplier
and placed in the top-left element of the product, and
so on. In mathcad this can be done by pressing -
(vectorize).

Thanks,
Jack
#2 Опубликовано: 22.10.2010 02:00:06
Radovan Omorjan

Radovan Omorjan

325 сообщений из 2 052 понравились и 1 не понравились пользователям.

Группа: Moderator

Hello,

No, there is no element-wise matrix operations in Smath (like vectorize in Mathcad). You just have to use loops (for, while) to perform such operations.

Regards,
Radovan
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#3 Опубликовано: 22.10.2010 21:19:06
iveyj1

iveyj1

0 сообщений из 2 понравились пользователям.

Группа: User

Ok, thanks for the quick response.

Is it possible to add operators via the plugin
mechanism or would that require a change to the core?

The reason I am interested in this functionality
is that I use it heavily in Mathcad to perform
similar calculations on a set of variables. The for
loop provides a similar functionality, but
the visual presentation is much more awkward,
unless I am missing something.

By the way, this is one of the best and most needed free
software I have come across.

Thanks,
Jack
#4 Опубликовано: 22.09.2025 09:11:58
Gerhard

Gerhard

0 сообщений из 1 понравились пользователям.

Группа: User

Haha, 15 years later, I'm facing the same problem. For my calculation of screw forces, I need the square distances of my screws and thought I could calculate them element by element.
Then I'll have to try to write a for loop.
#5 Опубликовано: 22.09.2025 09:51:35
federico

federico

6 сообщений из 7 понравились пользователям.

Группа: User

"Vectorize" is available and, if I understood your request, it should work for your use case without need of any loop.

image.png
  • Новые сообщения
  • Нет новых сообщений