Feeds
已回答
Im trying to find the summation from k=1 to 25, with the equation being k^2. This is my code, how do i get it do only display the final number only, not the ones in between?
Sum=0; for k=1:25; Sum = Sum + k.^2; end disp(sum)
Im trying to find the summation from k=1 to 25, with the equation being k^2. This is my code, how do i get it do only display the final number only, not the ones in between?
Sum=0; for k=1:25; Sum = Sum + k.^2; end disp(sum)
7 years 前 | 0