1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
horsena [70]
3 years ago
13

For each part create a vector n in which the first element is 1, the increment is 1 and the last term is 5, 50, or 5,000. Then u

se element-by-element calculations to create a vector in which the elements are 1 n 2 1n2. Finally, use MATLAB’s built-in function sum to sum the series. Compare the values to π2 / 6. Use format long to display the numbers.
Computers and Technology
1 answer:
Dennis_Churaev [7]3 years ago
4 0

Answer:

a = 1:5

b = 1:50

c = 1:5000

Explanation: the file script will be.

format long

% Part (a) n=1:5;

an=1./n.^2;

Sa=sum(an)

pi_sq_ov6=pi^2/6

% Part (b) n=1:50;

an=1./n.^2;

Sb=sum(an)

pi_sq_ov6=pi^2/6

% Part (c)

n=1:5000;

an=1./n.^2;

Sc=sum(an)

pi_sq_ov6=pi^2/6

Finding each values in the above, the command window will have the following values.

Command Window:

Sa = 1.463611111111111

pi_sq_ov6 = 1.644934066848226

Sb = 1.625132733621529

pi_sq_ov6 =1.644934066848226

Sc = 1.644734086846901

pi_sq_ov6 = 1.644934066848226

You might be interested in
Within the try clause of a try statement, you code a. all the statements of the program b. a block of statements that might caus
SVETLANKA909090 [29]

Answer:

B) A block of statement that might cause an exception.

Explanation:

Exception handling is a good programming technique that prevents our program from crashing when an exception occurs during execution. The try clause is used with a catch to handle any exception that might occur, so whenever a statement that might cause an exception is to be used, this should be contained in a try statement block of code.

5 0
3 years ago
Unless you explicitly initialize global variables, they are automatically initialized to
shusha [124]

Answer:

Zero(0)

Explanation:

<u>Global Variables </u>

Variables which are declared outside any function. Any function can use these variables,they are automatically initialized to zero(0).They are generally declared before main() function.

Example- C program for showing global variable is 0.

  #include <stdio.h>

   int g;  // declaring g as global variable

   int main()

   {

       printf("%d",g);  //printing global variable

       return 0;

    }

<u>Output</u>

  0

4 0
3 years ago
I WILL GIVE BRAINLIEST TO WHO ANSWERS FIRST AND CORRECTLY.
liq [111]
The number of bullet points on a slide should not exceed till 8
3 0
3 years ago
Computer are most wonderful creation of 21st century how ?​
son4ous [18]

Answer:

It can do all the functions at a speedy rate and also helps us to search and progress in our homes and businesses. A computer can therefore be called a calculator with a twist for not only does it perform fast calculations, but it also has other special characteristics.

Explanation:

hope it helps you

6 0
2 years ago
Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any
vampirchik [111]

Answer:

The code is given as follows,

Explanation:

Code:

#include <stdio.h>

#include <string.h>  

int n; //to store size of array  

char* ArrayChallenge(int arr[]) //function returns string true or false

{

  int i, j;

  int sum = 0;

  for(i = 0; i < n; i++)

  {

      sum = sum + arr[i]; //count sum

  }  

  for(i = 0; i < n; i++)

  {

      for(j = i+1; j < n; j++) //loop for every two elements in array

      {

          if(arr[i]*arr[j] > 2*sum) //check if proudct of two elements > 2 times sum

          {

              printf("\n%d x %d = %d, 2xSum = %d\n", arr[i], arr[j], arr[i]*arr[j], 2*sum);

              return "true"; //If proudct of two elements > 2 times sum. return true

          }

      }

  }

  return "false"; // If proudct of two elements < 2 times sum. return false

}  

int main()

{  

  printf("\nEnter size of array: ");

  scanf("%d", &n); //read size of array

  int A[n]; //array of size n

  printf("\nEnter array elements: ");

  int i;

  for(i = 0; i < n; i++)

  {

      scanf("%d", &A[i]); //read array from stdin

  }

  printf("%s\n",ArrayChallenge(A)); //ccall function and print answer

 

  return 0;

}

6 0
3 years ago
Other questions:
  • If str 1 and str2 are both Strings, which of the following expressions will correctly
    13·1 answer
  • Which line is not a computer-generated forecast?Which line is not a computer-generated forecast?the black line representing 20th
    12·1 answer
  • Complete this assignment in Python 3.x. Make sure you have downloaded the software, and it is installed correctly.
    10·1 answer
  • Which These operating systems use a graphical user interface?
    6·1 answer
  • In ____, two or more disk drives become one large volume, so the computer views the disks as a single disk.
    13·1 answer
  • Public class Square extends Shape{
    13·1 answer
  • Whats the difference between Input and Output? Give and example of an example on a M:B​
    15·1 answer
  • Please Help ASAP. Marking Brainliest For Correct Answer.
    5·1 answer
  • In attempts to improve their contribution to the environment a company decides to adapt green computing. Which of these techniqu
    13·1 answer
  • What is system software?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!