How can i construct a function without a recursion of for loops?

1 view (last 30 days)
Hi,
I am doing a radial basis interpolation of a function f. As a result i get a matrix B, with size n*m, which has stored the coefficients for my matrix.
In the following i want to set up the function f and perform an integration with respect to the x variable.
My code right now looks like this:
f = @(x,t) 0;
for k = 1:n
for j = 1:m
f = @(x,t) B(k,j) .* exp(-rbfConstantT .* (t-w(k)).^2) .* exp(-rbfConstantX .* (x-q(j)).^2) + f(x,t);
end
end
w(k) and q(j) are just parameters to shift the center of the gaussian kernel function.
Is the a way to perform this without two for loops?
I thought of something like multiplying matrices.

Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products


Release

R2013b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!