Finding a linear equation
조회 수: 2 (최근 30일)
이전 댓글 표시
TRAILOKYA
2019년 11월 5일
편집: JESUS DAVID ARIZA ROYETH
2019년 11월 5일
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!