mpower doesn't work with symbolic matrix
1 次查看(过去 30 天)
显示 更早的评论
I'm trying to create a symbolic experession of a matrix A raised to the power n, using a symbolic matrix variable (as introduced in R2021a).
However, I always get the following error:
% Create a symbolic 2x2 matrix
syms A 2 matrix
% Create a symbolic integer
syms n
assume(n, {'integer', 'positive'})
% Perform A^n
A^n
MATLAB says n isn't an integer, even though it is defined to be one. What am I doing wrong?
The same thing also happens when using the explicit syntax (mpower(A, n)).
----
Related documentation: (can't find anything about this in there)
0 个评论
回答(2 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!