フィルターのクリア

Cell Array and Matrix polynimial

1 回表示 (過去 30 日間)
RoboKid
RoboKid 2013 年 11 月 10 日
編集済み: RoboKid 2015 年 5 月 17 日
How do I subtract matrix polynomials? I want to subtract D which is a cell array from Y a matrix polynomial
syms s
X=[1 2 3 4; 5 6 7 8];
Y=(s-2)*X;
D = {[1 2 ] , [1 3] ; [1 6] , [5 2] };
M=Y-D
Currently i'm getting error for this code saying 'Error using mupadmex Cell input must have string contents.'

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 10 日
syms s
X=[1 2 3 4; 5 6 7 8];
Y=(s-2)*X;
D = {[1 2 ] , [1 3] ; [1 6] , [5 2] };
M=Y-cell2mat(D)
  7 件のコメント
RoboKid
RoboKid 2013 年 11 月 10 日
Is there anyway to change the class of D to sym from Double.
Azzi Abdelmalek
Azzi Abdelmalek 2013 年 11 月 10 日
編集済み: Azzi Abdelmalek 2013 年 11 月 10 日
cellfun(@(x) sym(x),D,'un',0)
In your case D is not double, it's cell

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by