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 filesfunction val1 = hthresh()function val2 = sthresh()and use the below code in another .m fileval1 = hthresh();val2 = sthresh();avg = (val1+val2)/2; Related SolutionsMATLAB: Getting an error “INDEX OUT OF BOUNDS” in the matlab program. Please help. for i=1:3 fepsn(i)=i; % (i) was added to avoid overwriting of the variable end MATLAB: How to make a log operation for a matrix excluding the ‘-inf’ values k should span from 1 to size(IDHMA,2), similar to ii:for ii = 1: size (IDHMA,1)for kk = 1 : size (IDHMA,2) IDHMAlog (ii,kk) = log(IDHMA(ii,kk)) if IDHMA(ii,kk) == 0 IDHMAlog(ii,kk) = NaN %exclude the"-Inf" values else IDHMAlog (ii,kk) = log(IDHMA(ii,kk)) endendendI believe you could avoid the loops if you'd like:IDHMAlog = log(IDHMA);IDHMAlog(IDHMA==0) = NaN; Related QuestionHyperlink from one *.m file to another *.m fileMaking a *.m file “read only.”Can i make a matrix like this
Best Answer