Replacing variables with dummy variables
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Roy Cornelissen
il 2 Ott 2018
Commentato: Star Strider
il 2 Ott 2018
Hello everyone,
I have obtained a really long equation in Matlab containing a lot of variables. Is there a function in Matlab that can find N suitable dummy variables in which it can compress the found combinations of the actual variables?
Forex:
y(x) = A*log(x)+A*B*sin(x)+C*e^x
Where:
A = 2*a+b+5*c+2*d
B = c+d/a
C = a^2+c^4/b+b/2
(the actual equation is much longer)
Thanks in advance!
2 Commenti
Adam
il 2 Ott 2018
What is wrong with doing it in exactly the way you show? Creating your own variables that roll together a number of other variables into a simpler equation.
Risposta accettata
Star Strider
il 2 Ott 2018
2 Commenti
Star Strider
il 2 Ott 2018
Please post the code you used, including the syms declaration.
You would likely have to use the expand function first, to get rid of the fractions, and if the result was a fraction, then use numden, and then simplify and coeffs on both the numerator and denominator.
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!