I need to run a specific function 4 times, each time passing new arguments to it (getting them from array) and save the result in another array after each iteration.
Here is my function:
function VD (x,y,z)
(2*x*y*z)/1000
Here are my arrays with values:
x = [1,2,3]
y = [4,5,6]
z = [7,8,9]
Here is where I'm getting a mistake:
for i=1:4
result{i} = VD(x(i),y(i),z(i));
end
Mistake - Subscript indices must either be real positive integers or logicals.
I'd like to have array result with 4 values, where each value is a result of VD function return.
Hope it's clear.
Thank you.