Inputs:
i1,i2,...,in
"or(and(not(i1),i2),xor(i3,i4))"
Output:
o=eval("or(and(not(i1),i2),xor(i3,i4))")
Is there any faster way than simulating Matlab's eval function in MEX function? Would the MEX eval be actually faster than native eval? If yes, how many times?
I've implemented eval as a MEX function. I tested it on random expressions of depth 4. My MEX eval is 2x faster than Matlab native eval (15.1s vs 31.4s, 1000 iterations)