Question

In the same script/editor Create a 70 by 70 matrix and implement the following: 1. All...

In the same script/editor Create a 70 by 70 matrix and implement the following: 1. All the elements in it are ? 2. All the elements in the diagonal are 4 and in the off diagonal are 0.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Create a 70 by 70 matrix

a = ones(70,70)

All the elements in it are ?

a = pi*a

All the elements in the diagonal are 4 and in the off diagonal are 0

for i = 1:70

for j = 1:70

if i==j

a(i,j) = 4;

else

a(i,j) = 0;

end

end

end

a

Add a comment
Know the answer?
Add Answer to:
In the same script/editor Create a 70 by 70 matrix and implement the following: 1. All...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using RStudio, Create an R-Script: (1) You will generate a numeric matrix of size 21 by...

    Using RStudio, Create an R-Script: (1) You will generate a numeric matrix of size 21 by 21 and will name it tmp. To do so, draw 21×21 = 441 random observations from the standard normal distribution. Before doing so, set the seed for the random number generator to 37. See help for set.seed(). (2) Change the diagonal elements of tmp to 1s. (3) Calculate condition number of tmp. See help for cond(). (4) Calculate the inverse of tmp. See help...

  • Using RStudio, Create an R-Script: (1) You will generate a numeric matrix of size 21 by...

    Using RStudio, Create an R-Script: (1) You will generate a numeric matrix of size 21 by 21 and will name it tmp. To do so, draw 21×21 = 441 random observations from the standard normal distribution. Before doing so, set the seed for the random number generator to 37. See help for set.seed(). (2) Change the diagonal elements of tmp to 1s. (3) Calculate condition number of tmp. See help for cond(). (4) Calculate the inverse of tmp. See help...

  • Please answer the 25,26, and 27 25) A square matrix A = (a ) is called...

    Please answer the 25,26, and 27 25) A square matrix A = (a ) is called diagonal if all its elements off the main diagonal are zero. That is, aij = 0 if j. (The matrix of Problem 24 is diagonal.) Show that a diagonal matrix is invertible if and only if each of its diagonal components is nonzero. 26.) Let a1i 0 0 0 a22 0 00ann be a diagonal matrix such that each of its diagonal components is...

  • In this assignment, you are asked to: 1. create a Matrix class that stores and operate...

    In this assignment, you are asked to: 1. create a Matrix class that stores and operate on a dynamic two-dimensional array. The class has the following structure: Private member variables: - int ** mat; - int rows; - int cols; Public member functions: +Default constructor: sets both rows and cols to 3 and creates 3x3 matrix dynamically +Parameterized constructor: sets the rows and cols to the values passed to the constructor and create a matrix with the given dimensions. +Destructor:...

  • Q 9 to 12 on matlab Create the following matrix by using vector notation for creating...

    Q 9 to 12 on matlab Create the following matrix by using vector notation for creating vectors with 9 constant spacing and/or the iinspace command. Do not type individual elements explicitly 20 3 в - 4 03 Using the colon symbol, create a 4 x 6 matrix (assign it to a variable named Anine) in which all the elements are the mumber 9. 10Create the following matrix by typing one command. Do not type individual elements explicitly C o o...

  • Create a class called Lab7b and in it implement all of the methods below. Also, write...

    Create a class called Lab7b and in it implement all of the methods below. Also, write a main method with test calls to all of these methods. Don’t forget to turn in your file to Canvas before the end of the lab today. int[][] random(int N, int start, int end) returns an N-by-N matrix of random integers ranging from start to end; int rowSum(int[][] a, int i) returns the sum of the elements in row i of the 2-D array...

  • This must be a C PROGRAMMING script using ARRAY. Thank you :) 3. Create a script...

    This must be a C PROGRAMMING script using ARRAY. Thank you :) 3. Create a script that will take an array of numbers and show the numbers in reversed order. Size of Array and elements have to be prompted to the user. Another Array variable of the same type should keep the numbers in reversed order. a. b. EX) If A 11, 2, 3,4, 5) was chosen as input, the output 8 should be B-(5, 4, 3,2, 1

  • Exercise 4 Step 1: Create a new editor window and save it as a file named...

    Exercise 4 Step 1: Create a new editor window and save it as a file named lab9ex4.py. Step 2: Use the function design recipe to develop a function named common_end. The function takes two lists of integers that are not empty, but which may have different lengths. The function returns True if they have the same first element or the same last element or if the first and last elements of both lists are the same. Otherwise, the function returns...

  • Problem 5 Create the following matrix by typing elements explicitly one command. Do not type individual...

    Problem 5 Create the following matrix by typing elements explicitly one command. Do not type individual 0 00 0 0 o o 0 0 0 0 0 1 2 3 F=0 01 10 20 0 0 2 8 26 0 0 3 6 32 E 0 045 6 0 0 7 8 9 Problem 6 Create two row vectors: a -4 10 0.5 1.8 -2.3 7, b [0.7 9 -53-0.6 12 (a) Use the two vectors in a MATLAB command...

  • 3. Write a MATLAB script that does the following: elements equal to 3. colum ,. Creates...

    3. Write a MATLAB script that does the following: elements equal to 3. colum ,. Creates a matrix having 200 rows and 100 columns with al that are in both the last 50 rows and the Changes the elements in the matrix of part a last 50 columns from 3 to 5. . ur script should make MATLAB do the heavy lifting. This means there should be arn to tpe unfstle In order to enter your script into a text...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT