a = 4 ᴫ r 2 . write a matlab function to compute the surface area. call your function to compute a at r = 5 and display the result. in matlab

main.m
function area = computeSurfaceArea(radius)
    a = 4 * pi * radius^2;
    area = a;
end

radius = 5;
result = computeSurfaceArea(radius);
disp(result);
152 chars
9 lines

related categories

gistlibby LogSnag