finding matrix base on linear equation

Risposte (1)

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
.

Categorie

Prodotti

Release

R2016a

Richiesto:

il 18 Gen 2022

Risposto:

il 18 Gen 2022

Community Treasure Hunt

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

Start Hunting!

Translated by