The annotation command is quite useful and can save time for sure. Unfortunately, it does not have any 'top right' commands, so you have to know/estimate the location for the textbook within your figure. The call to annotation might look like:
T = annotation('textbox','string',{sprintf(Producing %0.0f %s bats a week for %0.0f weeks = %0.0f total bats',num_bats(1,1),material_string,num_weeks(1,1),total_bats), ... sprintf(('Selling Price per bat: $%0.2f',selling_price(1,1)),... sprintf('Total Variable Cost per bat: $%0.2f',variable_cost),... sprintf('Fixed Cost of upgrade: $%0.2f',upgrade_cost),... sprintf('Profit: $%0.1e',profit(plength)), ... sprintf('Breakeven Point: %0.0f bat(s)',breakeven)}); T.Position = [x_start y_start x_length_normalized y_length_normalized]; %text box position and size T.LineStyle = '-'; %this is the type of line you would like around the box
By putting all the 'sprintf' statements in a cell, we can force each entry into a new line, so we don't have to use \n anymore. You can also call BackgroundColor, FontName, FontSize, etc. as parts of the structure 'T'.