# MATLAB: How to write a summation code when the k is not equal to j

double sumsumsummation

I want to write the code like this,and the rage of k is 1 to K,but i don't know how to write the " j is not equal to k" this summation code,can anyone show me how to write it ?

numPoints = 3; % Whatever...lambda = randi(9, 1, numPoints) % Whatever...f = randi(9, 1, numPoints) % Whatever...h = randi(9, 1, numPoints) % Whatever...K = length(lambda)outerSum = 0;for k = 1 : K	innerSum = 0;	% Do the inner sum over j with j not equal to k	for j = 1 : length(h)		if j == k			continue; % Skip this iteration		end		innerSum = innerSum + h(j) * f(k);	end	outerSum = outerSum + lambda(k) * innerSum;endouterSum % Spew out to the command window so we can see what it is.