Filter löschen
Filter löschen

Solve a Equation Guide

2 Ansichten (letzte 30 Tage)
Sergio
Sergio am 2 Mai 2012
I need solve a equation with values get form the guide
Normally I used the the command solve, but this command needs the variables into the line, I cant change....
Wherever i tried to do this way...
syms a b kc
x=0.1345*a+3.7;
y=2.31*kc-1.2;
z=3*b;
w=3*a-2.134;
t=3*kc-1.2;
u=2.145;
[a,b,kc]=solve(x==y,w==z,t==u)
but obviusly doesnt work

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 2 Mai 2012
Try
[a,b,kc] = solve(x-y,w-z,t-u,a,b,kc)
Your question about GUIDE is not clear. You can get() strings from edit boxes and str2double() the strings.
Are you trying to put the equations themselves in the edit box? That is possible: sym() the string and pass that into solve()
eq1 = sym(get(handles.BOX1, 'String'));

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by