编写一个函数文件计算三角形的面积,要求函数的输入为三角形三边的边长,输出为三角形的面积。公式见图片
function [ s ] = solve_area( a,b,c )
p=(a+b+c)./2;
s=(p.*(p-a).*(p-b).*(p-c)).^(1/2);
end
运行结果: