我用MATLAB定义了一个类来描述虚数,如下,并重载了+-*/运算符,但这些运算符只能计算单个complexS,如果想要让它支持向量化的计算,应该怎么做?
classdef complexS
properties
real,imag
end
methods
function obj=complexS(real,imag)
obj.real=real;
obj.imag=imag;
end
end
end