Output can be displayed only in Live Script (.mlx files) but not in plain script (.m files).
You can convert .m files to .mlx files with "Save As" in Editor tab.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!