for k = No_TimeSamples
for i = No_Pixels
SUM_1 = 0;
SUM_2 = 0;
for j = 1 : No_Geophones
delay = R(i, j)/c;
ik = round(delay/dt + k);
SUM_1 = SUM_1 + Data(ik, j);
SUM_2 = SUM_2 + Data(ik, j).^2;
end
image(i) = image(i) + SUM_1.^2 - SUM_2;
end
end
Note: naming a variable image is not recommended, as it interferes with using the image() display function and confuses readers.
2 Comments
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/445231-how-can-i-write-this-c-script-to-matlab#comment_671807
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/445231-how-can-i-write-this-c-script-to-matlab#comment_671807
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/445231-how-can-i-write-this-c-script-to-matlab#comment_671813
Direct link to this comment
https://de.mathworks.com/matlabcentral/answers/445231-how-can-i-write-this-c-script-to-matlab#comment_671813
Sign in to comment.