Hi Nobert,
Please find the below link which suggests function 'waveguide' to create a rectangular waveguide in MATLABhttps://in.mathworks.com/help/antenna/ref/waveguide.html
I hope this helps.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!