Finding a linear equation
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
JESUS DAVID ARIZA ROYETH
2019-11-5
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 个评论
JESUS DAVID ARIZA ROYETH
2019-11-5
编辑:JESUS DAVID ARIZA ROYETH
2019-11-5
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
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Digital Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!