Matlab Programming 1 Use for loop to determine the sum of th

Matlab Programming

1. Use for loop to determine the sum of the first 20 terms of the series 3k^2 - 2

Solution

MATLAB code:

clear all
close all
clc
sum=0;
for k=1:20
x=3*power(k,2)-2;
sum=sum+x;
end
sum

sample output

sum =

8570

>>

Matlab Programming 1. Use for loop to determine the sum of the first 20 terms of the series 3k^2 - 2SolutionMATLAB code: clear all close all clc sum=0; for k=1:

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site