function [ surface_area, volume ] = cube_and_sphere_calculator( geometry,l_r )
if geometry == 1
surface_area = 6 * l_r^2
volume = l_r^3
elseif geometry == 0
surface_area = 4*pi*l_r^3
volume = (4/3)*pi*l_r^3
else
disp('you have to choose a value that is either equal to one if you want to calculate the surface area and the volume of a cube or equal to zero if you want to calculate the surface area and the volume of a sphere')
end
end
If I put semicolons after the formulas, matlab gives only one output variable: ans. This answer is equal to the surface area. I want two output variables, and I want them to be surface_area and volume. Why doesn't it work?