4 ms·
Thanks for posting this -- I just went and fixed just such a loop in my own code.
by Pinckney 14y ago
Thanks for posting this -- I just went and fixed just such a loop in my own code.
- swanson 14y agoHa! Glad I could help :)
- Stwerp 14y agoMe too! I changed my array counter to 'j'. :P I work in matlab a lot and have had this error creep up several times. It's very annoying, to say the least.
- swanson 14y agoThe better fix - which I mentioned as well - is to use `2+3i` instead of `2+3*i`. The former will always use sqrt(-1).
- Stwerp 14y agoI agree. I think I picked up this syntax from Python. My response was intended as tongue-in-cheek answer since Matlab allows both i and j as the complex number. I mainly see this when editing or modifying scripts written by others in my lab and have to pinpoint their counter usage.