I am using HFSS matlab API to control HFSS from matlab. The program is working however, I can not introduce a magnetic material through hfssAssignMAterial.m. Does anybody know how to modify the code to introduce a magnetic material. I am also attaching the m file here. Also I am trying the get the peak gain of the antenna currently i can only look up to S_{11}, Is it possible to extract the peak gain, if so i would really appreciate any help.