Do ALL OF PARTS A-D. It says to do this in MATLAB, but as long as i get the corr
ID: 3775258 • Letter: D
Question
Do ALL OF PARTS A-D. It says to do this in MATLAB, but as long as i get the correct answer it doesnt matter.
Given the following list:
x= [34, 84, 76, 62, 80, 83, 11, 38, 31, 67, 11, 53, 86, 77, 55, 42, 58, 36, 37, 48, 72, 99, 15, 48, 95, 48, 60, 69, 25, 99, 66, 49, 84, 43, 12, 64, 26, 13, 92, 47, 71, 94, 90, 58, 71, 46, 90, 29, 73, 27, 67, 45, 27, 73, 84, 23, 21, 44, 82, 37, 44, 49, 77, 28, 82, 79, 82, 99, 83, 75, 46, 55, 69, 37, 13, 40, 74, 93, 60, 47, 21, 28, 83, 39, 91, 67, 52, 13, 12, 35, 40, 46, 74, 17, 65, 57, 87, 48, 56, 70, 23, 93, 25, 83, 31, 28, 23, 96, 22, 74, 43, 34, 92, 26, 64, 83, 84, 16, 86, 86, 42, 27, 33, 16, 35, 88, 64, 22, 36, 21, 83, 50, 15, 98, 33, 36, 27, 47, 32, 40, 22, 66, 65, 14, 83, 29, 88, 68, 36, 75, 54, 68, 92, 77, 75, 27, 66, 39, 39, 93, 51, 22, 44, 56, 21, 67, 83, 39, 15, 16, 70, 27, 72, 35, 32, 56, 54, 20, 24, 81, 85, 68, 49, 78, 46, 24, 95, 13, 54, 35, 96, 95, 48, 40, 51, 60, 98, 34, 90, 14];
Find (xi+i)2 for i=6 to 162
xi represents the 'i'th value in the list of x values.
Explanation / Answer
As mentioned not necessarily in MATLAB, i have just written the logic to implement the requirement and it could used in which ever language you want (basic logic is this , syntax could change according to language)
Part d :
int sum = 0
for(int i=6;i<=162;i++)
{sum = sum+(x[i]+i)*2;}
Part C :
Here we have total 200 elements so we will loop through all
int sum =0;
for (int i = 1;i<=200;i++)
{
if(x[i]<47)
{sum = sum +x[i];}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.