How can I operate a matrix by a vector?

1 次查看(过去 30 天)
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

采纳的回答

KSSV
KSSV 2021-9-26
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 = 

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Calculus 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by