Matlab:
Write a program that calculates and stores in a vector the results of the sum 9 + 99 + 999 + 9999 + .... for any number of components.
PROGRAM FOR GIVEN QUESTION:
%matlab program to find the sum of
%the series 9+99+999+9999+....
n=input('enter a number upto which you need sum:');
sum=0;
vector=[];
j=9;
for i=1:n
sum = sum + j;
vector=[vector j];
% Appending a 9 at the end
j = (j * 10) + 9;
end
disp(vector)
fprintf('sum of %d numbers is:%d\n',n,sum)
OUTPUT:
>> HomeworkLib
enter a number upto which you need sum:4
9
99
999 9999
sum of 4 numbers is:11106
Matlab: Write a program that calculates and stores in a vector the results of the sum...
.using while loops(matlab) Write a program to display the sum of the series [ 9 + 99 + 999 + 9999 ...] Test Data : Input the number or terms :5 Expected Output : 9 99 999 9999 99999 The sum of the series = 111105
4. Write a MatLab program that calculates the following indefinite integrals. The program should use pretty() to display both the original integrand and the integrated result, and also us
with explanation Write a C++ program that calculates and prints the average of several integers. Assume that the last value read with cin >> is the number 9999. For example, for an input sequence: 10 8 11 7 9 9999 The output should be 9.00
In MATLAB write a program that given the parameters from problem 13.171 (pg 900) that calculates the horizontal and vertical position of the ball after it strikes point A and until it lands at point B. Use a time increment in seconds that results in a smooth curve. Fully document your script file including a problem description and fully label your graph. from vector mechanics for engineers eleventh edition (Beer, Johnston...) chapter 13 problem number 171 8:24 PM Vector Mechanics...
Question 9 Write a MATLAB command that stores the maximum value in the row vector x and their indices in the row vector k for matrix A.
You will write a program in C that multiplies a matrix by a vector, using MATLAB to check the results. Create a program in MATLAB to solve the Topic 5 "File I/O" assignment. Use any built-in MATLAB functions of your choice. Some might require you to change your input files slightly; if so, document what you did and explain why. Compare and contrast the C and MATLAB versions of your code. works in matlab
You will write a program in C that multiplies a matrix by a vector, using MATLAB to check the results. Create a program in MATLAB to solve the Topic 5 "File I/O" assignment. Use any built-in MATLAB functions of your choice. Some might require you to change your input files slightly; if so, document what you did and explain why. Compare and contrast the C and MATLAB versions of your code.
Write a program with a loop and indexed addressing that calculates the sum of all the gaps between successive array elements. The array elements are doublewords, sequenced in nonde- creasing order. So, for example, the array {0, 2, 5, 9, 10} has gaps of 2, 3, 4, and 1, whose sum equals 10.
Write a program that reads two integer values. It then calculates and displays the sum and average of all values between them, Le. if the first value is vi and the second value is 2, then the program calculates and displays the sum and average of all values in the closed range Iv1,2 Your Program must satisfy the following constraints: A. make sure that v1 is less than 2 B. Use a function named getStats(that takes two integer yalues as...
java CountDigits.java Write a program that calculates and prints, the sum and product of all the digits in an integer value read from the keyboard.