MATLAB: How to define split-complex number

split-complex number

How can I define split-complex number a+j*b such that a and b are real and j is a new type an imaginary unit such that j^2=+1?

Best Answer

You would need to create a custom class for the object, where you will then define how arithmetic is to be performed. That is, you must overload the addition, subtraction, multiplication, etc., operators, as approriate and as necessary. That object would contain two fields, thus a and b. You would probably overload the disp/display functions too, since you will need to display this object.