MATLAB: Operation using *.m file

math function

Can we make mathematical operation by calling our *.m function? For example, I have hthresh.m and sthresh.m. I want to get the average value of these 2 file.

Best Answer

make hthresh.m and sthresh.m as function files
function val1 = hthresh()
function val2 = sthresh()
and use the below code in another .m file
val1 = hthresh();
val2 = sthresh();
avg = (val1+val2)/2;