X = [1,2,3,4,5,6,7,8,9];
Y = [4 5 6 9 8 7 4 1 2];
plot(X, Y, 'bo', 'LineWidth', 3, 'MarkerSize', 15);
grid on;
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
fontSize = 20;
title('lowcalorie Plot', 'FontSize', fontSize);
xlabel('X', 'FontSize', fontSize);
ylabel('Y', 'FontSize', fontSize);
coefficients = polyfit(X, Y, 1);
fittedY = polyval(coefficients, X);
hold on;
plot(X, fittedY, 'rs-', 'LineWidth', 3, 'MarkerSize', 15);
legend('Y', 'Fitted Y');
0 Comments
Sign in to comment.