% for loops in Matlab % Set the number of terms n=10; % initialize sum Q=0; % summing over k for k=1:n Q=Q+1/k^2; end sprintf('Approximation with %d terms: Q = %0.10g',n,Q)