Please help me with evaluating double sums
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dominic Marquez
el 2 de Dic. de 2020
Comentada: Dominic Marquez
el 2 de Dic. de 2020
Can someone help me do exactly this:
but in MatLab with the equation
Please and thank you.
0 comentarios
Respuesta aceptada
Image Analyst
el 2 de Dic. de 2020
You can do it with for loops, or with the meshgrid and sum functions:
x = 11 : 14
y = 2 : 5
% For loop way:
theSum = 0;
for i = 1 : 4
for j = 1 : 4
theSum = theSum + (x(i)^2 - 3 * y(j)^2 + x(i) * y(j)^3);
end
end
theSum
% Vectorized way using meshgrid:
[X, Y] = meshgrid(x, y);
theSum2 = sum(X(:) .^ 2 - 3 * Y(:) .^2 + X(:) .* Y(:) .^ 3)
Más respuestas (0)
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!