Finding a linear equation

2 visualizaciones (últimos 30 días)
TRAILOKYA
TRAILOKYA el 5 de Nov. de 2019
Editada: JESUS DAVID ARIZA ROYETH el 5 de Nov. de 2019
I have three variable like x,y, z. I need to find a linear relation between them like z=c1*x+c2*y+c3. Please help. Thanks

Respuesta aceptada

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH el 5 de Nov. de 2019
solution example:
x=rand(1,20);
y=rand(1,20);
z=3*x+4*y+7;
b=regress(z',[x' y' ones(size(x'))]);
fprintf('Equation is z=%0.2fx+%0.2fy+%0.2f\n',b)
  2 comentarios
TRAILOKYA
TRAILOKYA el 5 de Nov. de 2019
I have three data sets for x, y, z. I need to find z=f(x,y). Like the following z=x+c1*y-c2 (someone measured like this)
I dont understand why you have taken the coefficients for z already.
JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH el 5 de Nov. de 2019
Editada: JESUS DAVID ARIZA ROYETH el 5 de Nov. de 2019
because it is an example you can put anything in z and the program will look for the coefficients for you, x, y, z is your dataset

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by