I am trying to store function handles in array by running a loop and then adding them.
for i = 1:n^2
x1 = x_coord(elements(i,1));
x2 = x_coord(elements(i,2));
x3 = x_coord(elements(i,3));
x4 = x_coord(elements(i,4));
y1 = y_coord(elements(i,1));
y2 = y_coord(elements(i,2));
y3 = y_coord(elements(i,3));
y4 = y_coord(elements(i,4));
SF(elements(i,1)) = @(x,y)((x-x3)*(y-y3)/((x1-x3)*(y1-y3)) + SF(elements(i,1)(x,y))
end
Here I am saving function handles in array SF
and then adding them inside the loop.
But I am getting this error:
Error: ()-indexing must appear last in an index expression.
PLEASE HELP.