The harmonic series is the divergent infinite series Generat
The harmonic series is the divergent infinite series
Generate the members of the series until the condition x_k <= theta has been reached.
Design a Matlab program, which prompts the user to enter theta and gerates the series members as long as x_k > theta and stops this geration as soon as x_k <= theta becomes true. The series members shall be accumulated in an array. The program shall find the number of the series members that were generated. Print out the number of the series members that were generated and their sum using the fprintf command.
Run the program for theta = 01,.075, and 0.05
Prepare a technical resport summarizing your results. The report shall contain the number of the series members, which were generated and their sum for each of the three values of theta.
HERE IS MY CURRENT PROGRAM FOR SUCH......
What is am I missing to make this thing complete?
Thanks in advance......
clc
% Design a program for hte harmonic series
% 1/n = 1+1/2+1/3+1/4+1/5+...
% Prompt the user to enter starting and ending point of n
thata = input(\'Please enter the ending point for the series >> \');
n = 1:100;
x = 1./n; % Harmonic series
format short
for k = 1:100;
x(k) = x(k+1); % Next number in series
if x(k) > thata;
k = k + 1; % Interval of k
hem_seq(k) = x(k); % Accumulate the series into an array
fprintf(\'One number in sequence is %2.4f\ \',hem_seq\');
else
break
end
end
% Find the sum of the series members that were generated
total_sum = sum(hem_seq(:));
% Find the number of series members generated
total_num = length(hem_seq(:));
% Print out the number of the series members and their sum using fprintf
fprintf(\'The sum of the series members is %2.4f\ \',total_sum);
fprintf(\'The total number of members in series is %2.0f\ \',total_num);
Solution
A)
The subroutines in the GNU Scientific Library are “free software”; this means that everyone is free to use them, and to redistribute them in other free programs. The library is not in the public domain; it is copyrighted and there are conditions on its distribution. These conditions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of the software that they might get from you.
Specifically, we want to make sure that you have the right to share copies of programs that you are given which use the GNU Scientific Library, that you receive their source code or else can get it if you want it, that you can change these programs or use pieces of them in new free programs, and that you know you can do these things.
To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of any code which uses the GNU Scientific Library, you must give the recipients all the rights that you have received. You must make sure that they, too, receive or can get the source code, both to the library and the code which uses it. And you must tell them their rights. This means that the library should not be redistributed in proprietary programs.
Also, for our own protection, we must make certain that everyone finds out that there is no warranty for the GNU Scientific Library. If these programs are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation.
A list of known bugs can be found in the BUGS file included in the GSL distribution or online in the GSL bug tracker.1 Details of compilation problems can be found in the INSTALL file.
All bug reports should include:
It is useful if you can check whether the same problem occurs when the library is compiled without optimization.
The library is installed as a single file, libgsl.a. A shared version of the library libgsl.so is also installed on systems that support shared libraries. The default location of these files is /usr/local/lib. If this directory is not on the standard search path of your linker you will also need to provide its location as a command line flag.
The following command line shows how you would link the same application with an alternative CBLAS library libcblas.a,
For the best performance an optimized platform-specific CBLAS library should be used for -lcblas. The library must conform to the CBLAS standard. The ATLAS package provides a portable high-performance BLASlibrary with a CBLAS interface. It is free software and should be installed for any work requiring fast vector and matrix operations. The following command line will link with the ATLAS library and its CBLAS interface,

