cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

How to make this function to work also for scalars, if possible?

Cornel
18-Opal

How to make this function to work also for scalars, if possible?

Hi,

Cornel_0-1711961692172.png


How to make this expm function to work also for scalars:

Cornel_1-1711961756395.png

Cornel_2-1711961768366.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
LucMeekes
23-Emerald III
(To:Cornel)

You can use the function IsScalar(), like this:

LucMeekes_0-1711965165758.png

Success!
Luc

View solution in original post

5 REPLIES 5

In this way:

Cornel_0-1711962413570.png

But right now I inserted manually 1x1 matrix element.
So, giving a scalar value like (or any scalar value):

Cornel_1-1711962523436.png
expm function to be able to transform this scalar into 1x1 matrix element. Is it possible like this to add something like that in the above expm function? Or I need to be careful and put manually the 1x1 matrix element like above when I want to perform a calculation with this expm function with scalar values?

LucMeekes
23-Emerald III
(To:Cornel)

You can use the function IsScalar(), like this:

LucMeekes_0-1711965165758.png

Success!
Luc

LucMeekes
23-Emerald III
(To:Cornel)

In (express) Prime your function could be:

LucMeekes_1-1711967775783.png

then:

LucMeekes_2-1711967787632.png

gives:

LucMeekes_3-1711967800046.png

and:

LucMeekes_4-1711967822244.png

gives:

LucMeekes_5-1711967834875.png

Success!
Luc

 

Works also with your first suggestion also in Prime:
Cornel_0-1711968276331.png

 

Werner_E
24-Ruby V
(To:Cornel)

if A is a scalar, simply turn it into a 1x1 matrix

Werner_E_0-1712151474948.png

 

Top Tags