Gistlib Logo

gistlib

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(r)
    area = 4 * pi * r^2;
end

radius = 5;
surface_area = computeSurfaceArea(radius);
disp(surface_area);
143 chars
8 lines

similar matlab code snippets

how to calculate the skewness of a vector in matlab
how to calculate the minimum of a vector in matlab
how to calculate the range of a matrix in matlab
how to calculate the correlation of two vectors in matlab
calculate the area of a sphere in matlab
how to calculate the mean of a matrix in matlab
how to calculate the hessian of a function in matlab
how to calculate the indefinite integral of a function in matlab
calculate the area of a triangle in matlab
calculate the volume of a pyramid in matlab

related categories

matlab
function
geometry

gistlibby LogSnag