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.
YOu need not to worry about that..you may straight away use the operations on complex numbers. MATLAB will take care if it. To check whether given number is complex or not you can useisreal. This will be logical 0 iff the number is complex.
Best Answer