MATLAB: How to calculate Somme of vector elements sommevector i would like to calculate the somme k=1:10^5 of 1/k^2,using the command sum, can anyone help me ? Best Answer k=1:10.^5;sum(1./(k.^2)) Related SolutionsMATLAB: Building a set of simple moving averages using a loop Quantopic verified that the vector variable was of type double. As it was unclear how the SMAvector variables was declared, it was suggested that the following code be tried SMAvector = zeros(length(vector),30-5+1); for k = 5:1:30 SMAvector(:,k-5+1) = tsmovavg(vector,'s',k,2); endThat seemed to work. MATLAB: How change somme values on a matrix Hi Biza,It sounds like you want to do thresholding.A = A>20; % this makes A a logical matrix of 0 and 1, 1 is when A < 20A = A.*255;Anyway, this will do the job for you ;) Related QuestionHow can i plot y = 1/x*(x-1)How to download softdm in matlab R2010This algorithm produces a relative errorSumming to create a vectorHow to see script and command window side by side
Best Answer