How to find coefficient matrix?

4 visualizaciones (últimos 30 días)
Tom Braylovsky
Tom Braylovsky el 14 de Mayo de 2022
Editada: Torsten el 14 de Mayo de 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!

Respuesta aceptada

Torsten
Torsten el 14 de Mayo de 2022
Editada: Torsten el 14 de Mayo de 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

Más respuestas (0)

Categorías

Más información sobre Language Fundamentals en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by