[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
I and J variables
From: |
Eyal Doron |
Subject: |
I and J variables |
Date: |
Wed, 18 Jan 1995 17:35:12 +0100 (MET) |
Hi,
I know its a feature, but IMHO its an irritating one. I and J are
defined as sqrt(-1), like i and j, except that they are read-only
and can't be changed. This is playing havoc with some of my MATLAB
functions, which usually use I as an index vector and J as a bessel
function vector. I know its trivial to fix my files, but its
bothersome nevertheless. Is there any way to remove this feature?
BTW, I've just transferred a bessel function .m file from Matlab to
Octave 1.1.0. I needed to change the I variable name, and I also
got the warning: "warning: empty matrix found in matrix list" on
the lines
Ii=find(z); LI=length(Ii);
Jn(:,Ii)=[ones(1,LI);zeros(n,LI)];
when "z" contained only zeros. It seemed to work OK, though. I think
these warnings are superfluous, since empty matrices are not an error
but a natural part of the language. Again, solved by enclosing the
whole thing in an "if any(z)==1,...,end" block, which is however not
necessary in Matlab. Nevertheless, I'm impressed.
Bye,
Eyal Doron
- I and J variables,
Eyal Doron <=