MATLAB: Msgbox does not show title

msgbox

When trying to create a message box with a custom title, it does not show up for me.
CreateStruct.Interpreter = 'tex';
CreateStruct.WindowStyle = 'modal';
str_angle = sprintf('%.3f', angle);
str_true_vector_mag = sprintf('%.3f', true_vector_mag);
f = msgbox( {['Angle: ' str_angle '\circ'];['Distance: ' str_true_vector_mag ' m']} , 'Results' , CreateStruct);
I want the title to be 'Results', but for some reason the output does not show the title.
Thank you.

Best Answer

Your "Results" text isn't showing because the window is too small. Try making it wider as such:
angle = 30;
true_vector_mag = 15;
CreateStruct.Interpreter = 'tex';
CreateStruct.WindowStyle = 'modal';
str_angle = sprintf('%.3f', angle);
str_true_vector_mag = sprintf('%.3f', true_vector_mag);
f = msgbox({['Angle: ' str_angle '\circ'];['Distance: ' str_true_vector_mag ' m']} , 'Results' , CreateStruct);
f.Position(3) = 200; %<== MAKE FIGURE WIDER