More on using i and j as variables in Matlab: speed
The Matlab documentation says that For speed and improved robustness, you can replace complex i and j by 1i. For example, instead of using a = i; use a = 1i; The robustness part is clear, as there might be variables called i or j . However, as for speed , I have made a simple test in Matlab 2010b and I obtain results which seem to contradict the claim: >>clear all >> a=0; tic, for n=1:1e8, a=i; end, toc Elapsed time is 3.056741 seconds. >> a=0; tic, for n=1:1e8, a=1i; end, toc Elapsed time is 3.205472 seconds. Any ideas? Could it be a version-related issue? After comments by @TryHard and