<span>Here is matlab that should work
% cos(x) = 1 - (x^2)/2! + (x^4)/4! -(x^6)/6!+(x^8)/8!...
% let y= x*x
% cos(x) = sum( (-y)^n/(2n)! )
format short
x= 0.3*pi;
y= x*x;
for N= 1:6
n= 0:N;
s1= [(-y).^n./factorial(2*n) ]
mac= sum(s1);
cx= cos(x);
str= sprintf('%d terms. series: %12.10f cos(x): %12.10f\n %12.10f',...
N, mac,cx, (cx-mac));
disp(str);
end;</span>
False
---------------------------------------------
Programs are series of instructions interpreted by a computer
- The description of the program is to compute the square of the difference between corresponding elements of two arrays
- The better version of the program is program A.
<h3>How to describe the programs</h3>
From the programs, we have the following highlights
- The program iterates from 1 to n - 1
- The iteration calculates the difference between corresponding elements of the arrays
- The difference is then squared
Hence, the description of the program is to compute the square of the difference between corresponding elements of two arrays
<h3>The better version</h3>
The better version of the program is program A.
This is so, because the program uses fewer instructions for the same task as program B
Read more about programs at:
brainly.com/question/16397886