I think this sort of simple little thing does have significant use; it brings programming in ML closer to mathmatical notation. For example, why use csc(x) in stead of just 1./sin(x)? Because it's shorter and more clear. Why invent something like isvector(x) in stead of using any(size(x)==1) (+additional checks if you expect more dimensions)? Because it's another small little thinking step you can skip while reading code, making that code much more readable.
But only two stars for this version I'm afraid...indeed d=j==k is much shorter (and faster). Moreover, your function explicitly says d = 1; etc., which makes class(d) double i.s.o. logical. Also, you could use error(nargchk(2,2,nargin)) to do everything your entire error-check block does.