This seems to work
freeports = serialportlist("available")
str=sprintf('%s\t', freeports{1:end});
ReportMessage2(app,['Comms Available: ',str]);
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!