define one vector from another

define one vector from another - apply a operation on each vector element with results given in a second vector - 消息

#1 已发布: 2013/10/16 11:27:48
Jay May

Jay May

3个赞,共10个帖子。

组: User

I would simply like to define a vector, then apply a operation to each element and have the results in a second vector. This seems to be simple in MathCad but I can't seem to get it in SMath Studio.

In MathCad
mathcad vector.jpg

In SMath Studio I get this. I'm not shre just what this result is.
SMath vector.jpg

Any assistance would be appreciated.

Thank you.
#2 已发布: 2013/10/16 11:46:45
mb10

mb10

9个赞,共20个帖子。

组: User

The result is the sum of the squares of the elements, multiplied by two.
As far as I know SMath does not support vectorization (yet) so, in order to obtain what you need, you should use a for loop.
#3 已发布: 2013/10/16 12:01:48
Radovan Omorjan

Radovan Omorjan

325个赞和1个踩,共2,052个帖子。

组: Moderator

If you are using vectors, then you can try mat2sys() and sys2mat()

Regards,
Radovan
mat2sys.png
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
#4 已发布: 2013/10/16 13:35:36
Jay May

Jay May

3个赞,共10个帖子。

组: User

Thank you mb10, I got the For..Loop to work it out. I was wondering if the vector options were available or not.

To omorr, the mat2sys() and sys2ma() looks like a clean method to acheive these functionality but how do I add the mat2sys() and sys2mat() functions?

Thank you.
#5 已发布: 2013/10/16 16:46:28
Martin Kraska

Martin Kraska

1,362个赞,共2,276个帖子。

组: Moderator

mat2sys and sys2mat are part of the CustomFunctions plugin by Davide Carpi. You can install it using the extension manager (Tools> Plugins) or use the unofficial distribution with pre-installed plugins (link in the signature).

You also might consider using the Maxima Plugin (which requires Maxima to be installed on your system)
mat.PNG
Technische Mechanik mit SMath Studio: https://link.springer.com/book/10.1007/978-3-658-50592-9
1位用户喜欢此帖子
Radovan Omorjan 2013/10/17 01:06:00
  • 有新帖
  • 无新帖