Filter löschen
Filter löschen

Solving a set of linear equations interactively

1 Ansicht (letzte 30 Tage)
Chuzymatics Chuzymatics
Chuzymatics Chuzymatics am 13 Dez. 2014
Bearbeitet: per isakson am 13 Dez. 2014
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)

Antworten (0)

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by