4 ms·
>It's not really mutable, because it isn't a variable. However, if there is a variable by that name, Matlab will use it instead of the complex constant. This i
by fosap 14y ago
>It's not really mutable, because it isn't a variable. However, if there is a variable by that name, Matlab will use it instead of the complex constant.
This is what i mean with a sort of special syntax. It's awful corner case.
I don't like the Python syntax either. What would be wrong with Math.C(1,1) for 1+i? Or how about 1 + Math.I ?
- potatolicious 14y agoThe idea is expressivity - your solution seems boilerplatey and doesn't scale to longer expressions. The idea is to make math expressions as easy to write (and read) as it would be on paper, or at least get as close to it as possible. I don't have a problem with using i or j as the complex constant, as long as the necessary sanity checks exist to make sure it's not misused (e.g., duplicate declaration of i/j, overwriting i/j, etc).
- andreasvc 14y agoWell it is more verbose which matters if you do a lot of complex math. IMHO i, j, l should be avoided as variables anyway, as they are too similar visually; I prefer a, b, c & n, m for loop variables and indices.