how to simplify a symmatrix expression

16 ビュー (過去 30 日間)
GTCZD
GTCZD 2022 年 10 月 1 日
回答済み: Walter Roberson 2022 年 10 月 1 日
Three symmatrix type variables: Cn, MW0 and MDW0. I apply the command "simplify(Cn*(MW0+ MDW0) - Cn*MW0)" and I hope it output " Cn * MDW0". However, I only got an error "Incorrect number or types of inputs or outputs for function 'simplify' ". How to solve this issue? The following code block could reproduce this error. Thanks a lot.
syms MW0 [3 3] matrix
syms MDW0 [3 3] matrix
syms Cn [3 3] matrix
detlaC_1 = BiasCdiff1 - Cdiff1
sipReC_1 = simplify(BiasCdiff1 - Cdiff1) % the line throw out error

回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 10 月 1 日
syms MW0 [3 3] matrix
syms MDW0 [3 3] matrix
syms Cn [3 3] matrix
expression = Cn*(MW0+ MDW0) - Cn*MW0
expression = 
class(expression)
ans = 'symmatrix'
So the expression returns a symmatrix not a sym and not a symfun
methods(expression)
Methods for class symmatrix: adjoint csc display horzcat kron log mtimes power sin symmatrix2sym uminus cat ctranspose double inv latex minus ne pretty size tan uplus conj det eq isempty ldivide mldivide norm rdivide subs times vertcat cos diff exp isequal length mpower numel rhs sym trace vpa cot disp gradient isequaln lhs mrdivide plus sec symmatrix transpose Static methods: empty
Notice that simplify() is not one of the listed methods. Which is to say, that simplify() is not defined for expressions involving symmatrix.

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by