interpolating many functions



I am trying to accelerate the following 'stylized' piece of
code.
basically I need to do 1-dim interpolation many times.

for i=1:N
V = interp1(grid,W(:,i),A)
keep(:,:,i) = squeeze(sum(Z.*V)) ;
end

where grid is a vector, W is a matrix, A is a large 3d
*array*.
if possible I'd like to get rid of the loop..

I thought there might be a way with interp2, but...

Any idea would be much appreciated!



.



Relevant Pages

  • Re: assigning initial conditions on PDE solver?
    ... I can solve this equation easily using pdepe. ... mesh nodes, therefore a vector should have been sufficient. ... For second etc. runs of your loop ... it is possible to define INIFUN via interpolation: ...
    (comp.soft-sys.matlab)
  • Re: Logarithmic Interpolation
    ... > then exported back to excel. ... > for loop, for each pair? ... result after interpolation. ... in more than a single binary digit, ...
    (comp.soft-sys.matlab)
  • Re: discrete pm3d plots with gnuplot
    ... "with image" gets rid of the interpolation. ... values in the data file. ... This is very annoying if you want to compare ...
    (comp.graphics.apps.gnuplot)
  • Re: Replacing text containing parenthesis
    ... interpolation, and make things simpler. ... the s/// will help get rid of some of those backwacks, ... get rid of most of the rest: ...
    (comp.lang.perl.misc)
  • Re: Matrix interpolation
    ... I have tried this but still have a problem may be in loop. ... I have an interpolation problem similar to: ... How can I use the interp1 or interp2 comands to find the matrix corresponding to the value of say "15". ... this is a ONE dimensional interpolation problem. ...
    (comp.soft-sys.matlab)