Solving a set of linear equations interactively
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear All!
I intend to solve a set of linear equations using coefficients obtained from run time. Matlab displays:
solution =
x: [1x1 sym]
y: [1x1 sym]
symbolic expressions I cannot convert to readable numbers even with double() function. Pls help
% Code solves a general linear sim equation in two variables
% Accept coefficient of x in line one
a11 = input('Enter coefficient of x eqn one:')
a12 = input('Enter coefficient of y in eqn one: ')
c1 = input('Enter the constant term in eqn one:')
eqn_one = sym( 'a11*x + a12*y + c1');
a21 = input('Enter coefficient of x in eqn two:')
a22 = input('Enter coefficient of y in eqn two:')
c2 = input('Enter the constant term in eqn two:')
eqn_two = sym( 'a21*x + a22*y + c2');
solution = solve(eqn_one, eqn_two)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!