How can I operate a matrix by a vector?

1 visualizzazione (ultimi 30 giorni)
Jerson García
Jerson García il 25 Set 2021
Risposto: KSSV il 26 Set 2021
Hi, I need nelp.
I need to perform the following function f (x) = || Ax - b || ^ 2
A = [2 3, 1-2, 4 1];
b = [2,4, -5];
syms x1 x2
x = [x1 x2];
(sqrt ((A * x-b) ^ 2)) ^ 2

Risposta accettata

KSSV
KSSV il 26 Set 2021
A = [2 3 ; 1 -2 ; 4 1];
b = [2,4, -5]';
syms x1 x2
x = [x1 ; x2];
f = (sqrt ((A * x-b) .^ 2)) .^ 2
f = 

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by