How to assume 'symmatrix' variable as 'real'

9 ビュー (過去 30 日間)
Nishanth Rao
Nishanth Rao 2022 年 7 月 14 日
コメント済み: Walter Roberson 2022 年 7 月 14 日
I have created a few symbolic matrices:
syms x [6 1] matrix;
syms k [3 1] matrix;
syms C [3 6] matrix;
b_x = norm(C*x - k)^2;
I am creating a function and want to differentiate it w.r.t x.
d_b_x = diff(b_x, x);
But this generates complex operators like 'conj' which I don't want. I want to assume that all the matrices in this example contain real entries.
How can I do this? The documentation did not have any such commands.
  2 件のコメント
Nishanth Rao
Nishanth Rao 2022 年 7 月 14 日
編集済み: Nishanth Rao 2022 年 7 月 14 日
My question is how to assume a symmatrix as real. I just used the differentiation as an example of why I require it. Moreover, for bigger matrices the 'syms' makes the expression excessively long and difficult to interpret / use.
Anyways, thanks for your insight.
Nishanth Rao
Nishanth Rao 2022 年 7 月 14 日
編集済み: Nishanth Rao 2022 年 7 月 14 日
Please read the question title. I have asked about the variable type 'symmatrix'. The code in your question will create 6x1 vector but of variable type 'sym'. The code in my question will create a 6x1 vector (or matrix, however you see it) of variable type 'symmatrix'.
A lot of matrix calculus becomes easier with 'symmatrix' variable types.

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

採用された回答

Walter Roberson
Walter Roberson 2022 年 7 月 14 日
Matrix variables do not support assumptions. There does not appear to be any way to do what you would like to do.
  2 件のコメント
Nishanth Rao
Nishanth Rao 2022 年 7 月 14 日
編集済み: Nishanth Rao 2022 年 7 月 14 日
Hmm, I see.
Thanks a lot for the response. Would it be too much to ask for, if you can enable assumptions on symbolic matrix variables in future releases?
Walter Roberson
Walter Roberson 2022 年 7 月 14 日
I do not work for Mathworks, so that is not something that I can do.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by