Azzera filtri
Azzera filtri

Solve a Equation Guide

2 visualizzazioni (ultimi 30 giorni)
Sergio
Sergio il 2 Mag 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

Risposta accettata

Walter Roberson
Walter Roberson il 2 Mag 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'));

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by