フィルターのクリア

How can I create a quadratic matrix with variables?

3 ビュー (過去 30 日間)
Edoardo Cioffi
Edoardo Cioffi 2022 年 7 月 7 日
コメント済み: Karim 2022 年 7 月 7 日
I need to create the matrix of such that i get the matrix and so on? I need all the elements of the nxn matrix to be variables. I tried with :
syms q1dot q2dot q3dot q4dot q5dot;
qdot= [q1dot q2dot q3dot q4dot q5dot].'*[q1dot q2dot q3dot q4dot q5dot];
but it doesn't seem to work. Many thanks.

回答 (2 件)

KSSV
KSSV 2022 年 7 月 7 日
syms q [1 5] real
iwant = q'*q
iwant = 
  1 件のコメント
Karim
Karim 2022 年 7 月 7 日
you were a bit faster than me :) nice approach using the [1 5]!

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


Karim
Karim 2022 年 7 月 7 日
you do not need to use .' in this case, only use the transpose operator:
syms q1dot q2dot q3dot q4dot q5dot real
qdot= [q1dot q2dot q3dot q4dot q5dot]' * [q1dot q2dot q3dot q4dot q5dot]
qdot = 

カテゴリ

Help Center および File ExchangeNumbers and Precision についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by