I want to create a nested for loop that pulls 1x2 double elements from a 1x4 cell array V and adds them together. 1x2 double elements contain numbers (ex. [0.234 0.325]). I want to add those four 1x2 double elements together and store the value in an incrementing counter VSum. However, MATLAB is returning [NaN NaN]. How do I fix this?
Additional info: A is a 50x50 cell array
VSum = [0 0];
for i = 1:1:size(G,2)
for j = 1:1:size(G,1)
for p = 1:1:4
V{p} = (A{i,j}{p}*Q)/(2*pi*norm(Z{i,j}{p}));
VSum = V{p}+VSum;
end
end
end
Z? I'm guessing there is a0somewhere inZ- TinyTheBrontosaurusnorm(Z{i,j}{p})is0somewhere - TinyTheBrontosaurus