finding matrix base on linear equation

hello,
given a linear quation, y=ax+b y=-0.15x-21.3, how can find a matrix for y=Ax?
thanks

답변 (1개)

Star Strider
Star Strider 2022년 1월 18일

0 개 추천

I’m not certain what the desired result is here.
Try this —
x = linspace(-10, 10, 5);
y = -0.15*x-21.3;
X = [x(:), ones(size(x(:)))] % Design Matrix
X = 5×2
-10 1 -5 1 0 1 5 1 10 1
Coefficients = X \ y(:) % Proof
Coefficients = 2×1
-0.1500 -21.3000
.

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

제품

릴리스

R2016a

질문:

2022년 1월 18일

답변:

2022년 1월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by