Message Boards Message Boards

GROUPS:

Let ^ correctly call MatrixPower and Power

Posted 3 months ago
355 Views
|
0 Replies
|
0 Total Likes
|

I want to use ^ to call MatrixPower and Power correctly in my calculation. For example:

In[104]:= m={{0, -1, 0, 1/2}, {0, 0, -1, 1/2}, {-1, 0, 0, 1/2}, {0, 0, 0, 1}};
m^4
MatrixPower[m,4]
2^4

Out[105]= {{0, 1, 0, 1/16}, {0, 0, 1, 1/16}, {1, 0, 0, 1/16}, {0, 0, 
  0, 1}}

Out[106]= {{0, 1, 0, 0}, {0, 0, 1, 0}, {1, 0, 0, 0}, {0, 0, 0, 1}}

Out[107]= 16

I want m^4 is executed as MatrixPower[m,4] and 2^4 is executed as Power[2,4] automatically. Any tips for achieving this goal?

Regards,
Zhao

POSTED BY: Hongyi Zhao
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract