myFile = fopen('values.txt', 'w');
fprintf(myFile, "x\t y\t h\t p\t a\n");
fprintf(myFile, "%d\t\t\t%d\t\t\t%.2f\t\t\t%.2f\t\t\t%.2f\n", i, j, ...
myHypot, myPerim, myArea);
perimeters = [perimeters, myPerim];
hypots = [hypots, myHypot];
plot(perimeters, areas, 'o-');
title('Perimeter vs. Area');
[X, Y] = meshgrid(1:5, 1:5);
mesh(X, Y, reshape(hypots, [5, 5]));
zlabel('Hypotenuse Length');
title('Mesh plot of Hypotenuse Length');
function hValue = hValue(xValue,yValue)
hValue = sqrt(xValue.^2 + yValue.^2);
function pValue = pValue(xValue,yValue)
pValue = xValue + yValue + sqrt(xValue.^2 + yValue.^2);
function aValue = aValue(xValue,yValue)
aValue = 0.5 * xValue * yValue;