The scaleruler function in the Mapping Toolbox is powerful, but it can be a bit clunky and difficult to work with. This scalebar function is a simpler, less powerful alternative. Simply type "scalebar" for a 100 km scale bar in the lower left corner of your map. For more complex preferences, try any of these:
scalebar('length',200) for a 200 km scale bar.
scalebar('length,200,'color','blue') for a blue one (shown in the image of Texas above).
scalebar('location','southeast','fontangle','italic') places a scale bar in the lower right corner with italic text.
Keep adding linespec or text property commands as name-value pairs. Can also create a vertical scalebar with 'orientation','vertical'.
Disclaimer: This scale bar is intended to show approximate distances. The scale is inexact, and errors increase with the size of any map. In fact, it's probably poor practice to put any scale reference on a map of an area as large as Texas. Nonetheless, this scalebar function will display a ballpark size reference.