MATLAB Answers

How can I operate a matrix by a vector?

23 views (last 30 days)
Jerson García
Jerson García on 25 Sep 2021 at 15:38
Answered: KSSV on 26 Sep 2021 at 7:12
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

Answers (1)

KSSV
KSSV on 26 Sep 2021 at 7:12
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 = 

Community Treasure Hunt

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

Start Hunting!