I think you may be confused. I believe what is asked is for a function with ARBITRARY inputs, in the sense it can be called with any arbitrary pair of numbers. I have often seen the word random used as was done, in a way that is perhaps confusing to some, when really all they intended was as a synonym of the word arbitrary.
function area = tri_area(b,h)
Don't assign values to b and h inside the function. PASS THEM IN. Now, use the function, as you wrote it.
>> area = tri_area(2,3)
>> area = tri_area(5,pi)
>> area = tri_area(5,sqrt(2))
>> area = tri_area(2.35,17.4545644)
As you see, it now works for any set of base and heights.
You don't want to re-set the values of those parameters passed in. That was your only problem.