From: James Tursa on 5 Apr 2010 14:42 "us " <us(a)neurol.unizh.ch> wrote in message <hpd468$gr4$1(a)fred.mathworks.com>... > > for i=1:nt > xr(i,1)=sum(x2); > end > r=all((xr-xr(1))==0) > % r = 1 You need to be very careful with tests like this in MATLAB. Sometimes the JIT accelerator will recognize that certain calculations don't change inside a loop and move that calculation outside the loop, effectively torpedoing your intended test. You may need to wrap such function tests inside another function to coax JIT into not optimizing it out of the loop. I know this happens with matrix multiply operations as I had a heck of a time (and still do) designing meaningful timing tests for my mtimesx FEX submission. James Tursa
|
Pages: 1 Prev: Control Theory PID tuning Next: Elliptic PDEtoolbox trouble!! |