MATLAB: How to align strings with the same length in a uicontrol object in MATLAB

alignfixedwidthfontfontnameMATLABsamescalestringuicontrol

I am trying to align the strings in my listbox. I have ensured that they all have the same length, but they are not aligned.

Best Answer

Strings with the same length can be aligned in a uicontrol object in MATLAB by setting the "FontName" property to "FixedWidth". This can be done either by using the INSPECT function to open the Property Inspector or by uding the SET function as shown below:
set(uicontrol_handle, 'FontName', 'FixedWidth')
where "uicontrol_handle" is the handle to the uicontrol