How to find coefficient matrix?

14 vues (au cours des 30 derniers jours)
Tom Braylovsky
Tom Braylovsky le 14 Mai 2022
Modifié(e) : Torsten le 14 Mai 2022
Hello everyone,
I need to find a coefficient matrix called 'A'.
I heve vector 'Re' and a result vector 'f'. Bouth vectors are (1:430) size and are known.
The equation looks like this: A * Re = f
how can i do it?
Vectors file included, only (1:430) is needed.
Equation system format included. Matrix 'A' is the a's, 'Re' is the X's and 'f' is the Y's.
Hope I was clear enougth, thanks for the help!

Réponse acceptée

Torsten
Torsten le 14 Mai 2022
Modifié(e) : Torsten le 14 Mai 2022
I assume the last xi^n should be xi^m in
sum_{i=1}^{n} y_i*x_i^n
x = [1 3 5 7 9];
y = [3 -1 3 78 -0.2];
m = 4;
xx = x.^((0:2*m).');
xxx = sum(xx,2).';
A = reshape(cell2mat(arrayfun(@(i)xxx(i:i+4),1:m+1,"UniformOutput",false)),m+1,m+1);
b = xx(1:m+1,1:m+1)*y.';
a = A\b

Plus de réponses (0)

Catégories

En savoir plus sur Language Fundamentals dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by