Matrix dimensions must agree

2 vues (au cours des 30 derniers jours)
Michel Lopes Villaluz
Michel Lopes Villaluz le 27 Mai 2020
Réponse apportée : Tommy le 27 Mai 2020
Hi! Mi program show me a mistake with my matrix but both have nine values in x and y.

Réponses (1)

Tommy
Tommy le 27 Mai 2020
A is a 4x9 array, so A' is a 9x4 array.
A.*A'
This tries to use element-wise multiplication on A and A', but they aren't the same size (or compatible), so you get an error.
Maybe you mean this?
a=A*A'\A*y';
This performs matrix multiplicaton on A and A', resulting in a 4x4 array which you can then pass to mldivide along with A*y' (a 4x1 array).

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by