MATLAB: Problem with double sums double sums how to write this function in MATLAB knowing that if I separate the two sums as I wrote one tends to infinity. The first idea I wrote then check my code in some values of f as an example but the result is because Best Answer https://fr.mathworks.com/matlabcentral/answers/497684-problem-with-double-sums#comment_780161 Related SolutionsMATLAB: Average and variance of a double array doc meandoc var MATLAB: Compute double sum or double integral throug sum If the ultimate goal is to compute the integral, you can consider using integral2https://www.mathworks.com/help/matlab/ref/integral2.htmlIf you have to do it with sum, then since you already computed u2 for all values, it is justx=[-20:0.2:10]; y=[-10:0.2:5]'; u2=-3*exp(-sqrt(x.^2+y.^2)/2);sum(u2(:))*0.2*0.2Note that you have to transpose x or y so it forms a gridHTH Related QuestionDouble sum – vector (matrix) solutionSumFinding average of a sensor signalDouble summation with nested sumHow to write code for double summationCalculation of a double sumHow to “solve” a “function”Double sum with upper limits
Best Answer