f = figure();
MAPE = [1.234 2.123 1.034 0.234];
MSE = [2.20 1.20 2.23 1.10];
R2 = [0.9 0.7 0.8 0.9];
ax = gobjects(1,4);
for i=1:4
ax(i) = subplot(2,2,i);
plot((1:10)+2*rand(1,10));
xLeft = ax(i).XLim(1);
xDiff = diff(ax(i).XLim);
yTop = ax(i).YLim(2);
yDiff = diff(ax(i).YLim);
text(xLeft+0.05*xDiff, yTop-0.05*yDiff, ['MAPE=' num2str(MAPE(i))], ...
'HorizontalAlignment', 'left', 'VerticalAlignment', 'top', 'Interpreter', 'latex');
text(xLeft+0.05*xDiff, yTop-0.15*yDiff, ['MSE=' num2str(MSE(i))], ...
'HorizontalAlignment', 'left', 'VerticalAlignment', 'top', 'Interpreter', 'latex');
text(xLeft+0.05*xDiff, yTop-0.25*yDiff, ['$R^2$=' num2str(R2(i))], ...
'HorizontalAlignment', 'left', 'VerticalAlignment', 'top', 'Interpreter', 'latex');
end
Best Answer