On 6/7/14 5:11 PM, Jan wrote:
> I have already found out, that I can create function handle via matlabFunction and accelerate substitution of numbers, but is there any way of making the process of creating the "general expression" faster, please?
Without seeing the actual formulas, this is just stabbing in the dark,
but you may find it useful to call simplify on your intermediate
results. Also, if you are not actually interested in the symbolic
result, but only want it to plug in numbers, using a sequence of
functions generated by matlabFunction may be a better option.
> So i used something like
>
> R0=transformation(a1,a2,a3...,initial vector);
> R1=transformation(b1,b2,b3....,S);
> R2=transformation(c1,c2,c3....,R1);
>
> R2=subs(R2,S,R0)
>
> what increased the speed of the code.
>
> (But now I have got six transformations and subs does not help a lot, do you know, how implement matlabFunction into this example? And would it be useful?)
fR0 = matlabFunction(R0, ...);
fR2 = matlabFunction(R2, ...);
value = fR2(c1,c2,...,fR0(a1,a2,...))
HTH,
Christopher