This is the code that I'm currently using:
A = interpolate; averg = mean([A(1:end-2),A(3:end)],2); streaking = []; for idx = 2:size(A,2)-1 streaking(:,idx) = (abs(A(:,idx)-averg(idx))./averg(idx))*100; end
The full error message:
>> Attempted to access averg(2); index out of bounds because numel(averg)=1.
>> Error in rad_cal2 (line 817)
streaking(:,idx) = (abs(A(:,idx)-averg(idx))./averg(idx))*100;
interpolate is a matrix
Best Answer