I have a 130-line function written in MATLAB which I need translated into Mathematica (version 4.1). It would also help if you were proficient enough in mathematics to help me understand this routine better. Its purpose is to perform a more advanced type of interpolation between multiple values. Since I'm not knowledgable about MATLAB, I'm not sure if the routine I'm providing for translation is dependent on other functions not provided. If so, I need to have them identified so I can find perhaps more MATLAB code that you would need to translate as part of this little project. If I like the work you do, I may ask you for a follow-on project where the code would be translated in C. Here is a code snippit from the actual code I need translated: function fi = invdisti(R,Ri,f,opt) % Defaults and parameters ............. tol = 1e-10; % Substitute for zero distance l_ch = 200; % Chunk length opt_dflt = 3; % 3 estimates (r^(-d-1), r^(-d-2), % r^(-d-3) % Handle input ........................ if nargin==0, help invdisti, return, end if nargin<3 error(' Not enough input arguments') end if nargin<4, opt = opt_dflt; end % Sizes and dimensions ................ sz = size(R); szi = size(Ri); if sz(1)==szi(1) & sz(2)~=szi(2) R = R'; Ri = Ri'; elseif sz(1)==szi(2) & sz(2)~=szi(1) R = R'; elseif sz(2)==szi(1) & sz(1)~=szi(2) Ri = Ri'; end [npb,d] = size(R); [npi,d] = size(Ri); % Option ......... if length(opt)>1 comp_coef = opt(:); else opt = max(opt,1); comp_coef = ones(ceil(opt),1); end comp_coef = comp_coef/sum(comp_coef); n_comp = length(comp_coef); szf = size(f); is_trp = 0; if szf(2)==npb & szf(1)~=npb, f = f'; is_trp = 1; end % Number of chunks n_chi = ceil(npi/l_ch); n_chb = ceil(npb/l_ch); % Initialize summation matrices .......... Sf = zeros(n_comp,npi); Sw = Sf; % Begin calculating distance matrices between % chunks of basis points and chunks of interpolation % points % For each chunk find distance matrix ************** for ji = 1:n_chi % Chunks of interp. points `````````0 % Get current chunk li = min(ji*l_ch,npi); i_chi = (ji-1)*l_ch+1:npi; ...
## Deliverables
Complete and fully-functional working Mathematica source code which can take reasonable inputs and produce outputs for me to further experiment with. Complete copyrights to all work purchased.
## Platform
Since Mathematica is a cross-platform IDE-type coding/execution environment, it doesn't really matter what machine you use. Your working code should work the same on my Macintosh. I run MacOS 9.1.