MATLAB: How to calculate this sym of serie seriesum z=q+q*(q-1)+q*(q-1)*(q-2)+…+q*(q-1)*(q-2)*…*(q-n) Best Answer Try this intuitive, brute force method:clc;% Sample numbers:q = 10;n = 3;theSum = 0;for k = 0 : n qArray = q : -1 : q-k; p = prod(qArray) theSum = theSum + p;end% Print to command windowtheSum Related SolutionsMATLAB: How to write Continue Long Statements on Multiple Lines Use repmat to avoid manually typing all 160 of those ‘%q’ repeats! Try this: formatSpec = ['%f',repmat('%q',1,160), '%[^\n\r]']; MATLAB: Dear friends, the long matlab command that I have written is error. I want to be spelled the same way but without error. Do it like the second example on this documentation page about continuing long statements on multiple lines. Related QuestionHow to make a heatmap for a monthly time serieThe headerlines are not always properly detected by readtableSerie with randnHow to write Continue Long Statements on Multiple LinesSubscript – Symbolic serie
Best Answer