Correcting data by equation parameters
-
Hi,
What do you mean by "command line" ?
-
Are you looking to implement something like SpeedCrunch ?
-
-
@erytcg
yeah should be as you can just treat the variable as a number and substitute when you calculate the result.
it also support operator precedence but stuff like
x=(1.3x+1)^2;
will require somewhat a more data complex model to handle flawless i think. -
And one more question this algorithm is fast? I have a looot of data and I have to calculate it in real time:D
-
Depending on what you need to handle, maybe using something like
https://github.com/ArashPartow/exprtk ? -
Can I use QScriptEngine?
But I have problem
#include <QtScript/qscriptengine.h> #include <QtScript/qscriptvalue.h> QString x = ui->correctDataLine->displayText(); QScriptEngine myEngine; QScriptValue x2 = myEngine.evaluate(x); qDebug() << x2.toNumber(); undefined reference to `_imp___ZN13QScriptEngineC1Ev'
-
Can I use QScriptEngine?
But I have problem
#include <QtScript/qscriptengine.h> #include <QtScript/qscriptvalue.h> QString x = ui->correctDataLine->displayText(); QScriptEngine myEngine; QScriptValue x2 = myEngine.evaluate(x); qDebug() << x2.toNumber(); undefined reference to `_imp___ZN13QScriptEngineC1Ev'
-
Ah I see where you are aiming :)
Yes you can use it for your use case. Depending on the complexity you need.
http://www.informit.com/articles/article.aspx?p=1405559&seqNum=2
Using script with js to play calculator.