필터 지우기
필터 지우기

Getting numeric and symbolic coefficients of equation of a straight line in 2d or 3d

조회 수: 2 (최근 30일)
Consider the general equation of a straight le in 3d a*x + b*y + c*z + d=0. I would like to get a vector giving [a,b,c,d] including those that are zero or infinity. a,b,c,d can be both numeric and symbolic
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2020년 6월 9일
a*x + b*y + c*z + d = 0
is an equation of plane (not line) in 3D. How do you want to find the values of [a,b,c,d]? Do you want to estimate it using curve-fitting?
Saikat Banerjee
Saikat Banerjee 2020년 6월 9일
Lets say as an example a equation is given as 7*x - 8*y + d. So my return value or answer is [7,-8,0,c]. I simply want the symbolic/numeric co-efficients of x, y, z, 1. including 0 coefficients

댓글을 달려면 로그인하십시오.

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 6월 10일
편집: Ameer Hamza 2020년 6월 10일
Try this
syms x y z
f = -9*x + 7*z + 9;
cd = subs(f, [x y z], [0 0 0]);
cx = subs(f, [x y z], [1 0 0])-cd;
cy = subs(f, [x y z], [0 1 0])-cd;
cz = subs(f, [x y z], [0 0 1])-cd;
cd = subs(f, [x y z], [0 0 0]);
c = [cx cy cz cd];
  댓글 수: 6

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Formula Manipulation and Simplification에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by