MATLAB: What is the problem in this following program? Why the function isn’t working

functionmatlab function

function [area] = tri_area(b,h)
tri_area(b,h)=(0.5)*(b)*(h)
area = tri_area(b,h)
end

Best Answer

Define it like this
function [area] = tri_area(b,h)
area = (0.5)*(b)*(h);
end
Related Question