Skip to main content
19-Tanzanite
April 1, 2024
Solved

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

  • April 1, 2024
  • 4 replies
  • 1400 views

Hi,

Cornel_0-1711961692172.png


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

Cornel_1-1711961756395.png

Cornel_2-1711961768366.png

 

 

Best answer by LucMeekes

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

LucMeekes_0-1711965165758.png

Success!
Luc

4 replies

Cornel19-TanzaniteAuthor
19-Tanzanite
April 1, 2024

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?

LucMeekes23-Emerald IVAnswer
23-Emerald IV
April 1, 2024

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

LucMeekes_0-1711965165758.png

Success!
Luc

23-Emerald IV
April 1, 2024

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

 

Cornel19-TanzaniteAuthor
19-Tanzanite
April 1, 2024

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

 

25-Diamond I
April 3, 2024

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

Werner_E_0-1712151474948.png