I understand you're looking to optimize an antenna created from a pcbStack object and have encountered issues with the optimize function, as it doesn't support pcbStack objects. I've faced similar challenges.
As a workaround, you can export the antenna to a Gerber file using the gerberWrite function from the Antenna Toolbox:
gerberWrite(antennaObject)
Alternatively, you can save the antenna object to a .mat file with the following command:
save(antennaObject,"pcbObj.mat")
Once you have exported the antenna as a Gerber file or saved it as a .mat file, you can import these files into the pcbAntennaDesigner for optimization.
For more detailed information, please refer to the MATLAB R2023a documentation:
- gerberwrite: https://www.mathworks.com/help/releases/R2023a/rfpcb/ref/gerberwrite.html
- save: https://www.mathworks.com/help/releases/R2023a/matlab/ref/save.html
Hope it helps!