MATLAB computations on variables?

2 vues (au cours des 30 derniers jours)
Hassan Taymuree
Hassan Taymuree le 28 Oct 2021
Commenté : Walter Roberson le 28 Oct 2021
Is it possible to conduct MATLAB operations on just a matrix of variables? For example, if I wanted to compute the inverse of matrix
A = [a b; c d]
without assigning any values to any of the 4 variables just to get a general form. Thanks in advance!

Réponses (1)

Chris
Chris le 28 Oct 2021
Modifié(e) : Chris le 28 Oct 2021
The symbolic toolbox is great for stuff like this.
syms a b c d
A = [a b;c d]
A = 
inv(A)
ans = 
  1 commentaire
Walter Roberson
Walter Roberson le 28 Oct 2021
Caution: the size of the matrix expands quite rapidly for larger matrices.
syms M [4 4]
inv(M)
ans = 

Connectez-vous pour commenter.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by