Question

using matlab: Q)using nested for loops to generate a 3*3 matrix where the element value is...

using matlab:

Q)using nested for loops to generate a 3*3 matrix where the element value is equal to the sum of its row and column number,

except for the diagonal elements which are zeros

Homework Answers

Know the answer?
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
Similar Questions
Nested For Loops a. Create a 10×15 matrix with NAs. b.Assign [i,j] th element( ith row...
Nested For Loops a. Create a 10×15 matrix with NAs. b.Assign [i,j] th element( ith row and jth column value ) as i × j by using nested for loops. Provide R code Plz
Write a code in matlab for going through every element in a imported image matrix that...
Write a code in matlab for going through every element in a imported image matrix that has been gray scaled using for loops (going through every row and column) and changing every element that is equal to 255 to 1 and every number less then 255 equal to 0. Then find the x and y coordinate of each element now equal to 0 in that image matrix once again going through each row and column.
In the code space provided in Matlab Grader, create a function that: 1. Accepts an input...
In the code space provided in Matlab Grader, create a function that: 1. Accepts an input matrix A as its only input argument. Matrix A is a 3x3 matrix of random integers between 1 and 4 2. Produces and output matrix B as its only output argument. Matrix B will also be a 3x3 matrix. 3. Calculates the elements of matrix B such that: a. the values of B along the diagonal are equal to the respective elements in A...
Generate a 4 x 4 random integer matrix, save it in the variable mat and perform...
Generate a 4 x 4 random integer matrix, save it in the variable mat and perform the following: ( MATLAB) Generate a matrix from the matrix mat that is composed of row 2, row 1 and row 3 of mat Generate a matrix from the matrix mat that is composed on column 2 and 3 of mat Generate a matrix from the matrix mat that starts with column 2 and row 3 and contains all the elements till the end.
create program using matlab, that displays number of (+) entries (=>0) in matrix and number of...
create program using matlab, that displays number of (+) entries (=>0) in matrix and number of negative (<0). Hard code matrix in program. Use nested loops and an if-else-end structure to count (+) and (-) entries. Program should display original matrix and number of positive/negative entries.
create program using matlab, that displays number of (+) entries (=>0) in matrix and number of...
create program using matlab, that displays number of (+) entries (=>0) in matrix and number of negative (<0). Hard code matrix in program. Use nested loops and an if-else-end structure to count (+) and (-) entries. Program should display original matrix and number of positive/negative entries.
All these to be done in MATLAB: 1.1)Define a column vector, called “b” in MATLAB that...
All these to be done in MATLAB: 1.1)Define a column vector, called “b” in MATLAB that stored floating point numbers between 0.6 to 2.5 in increment of 0.2. 1.2)What is the size of vector b? How is the size of ‘b’ stored? Define number of rows of ‘b’ in variable ’row’ and number of columns of “b” in variable “col”. 1.3)Define matrix “A” as a 10 by 10 matrix of all “1”s. 1.4)Update matrix “A” as following: set all the...
*** Write a function called reverse_diag that creates a square matrix whose elements are 0 except...
*** Write a function called reverse_diag that creates a square matrix whose elements are 0 except for 1s on the reverse diagonal from top right to bottom left. The reverse diagonal of an n-by-n matrix consists of the elements at the following indexes: (1, n), (2, n-1), (3, n-2), … (n, 1). The function takes one positive integer input argument named n, which is the size of the matrix, and returns the matrix itself as an output argument. Note that...
MATLAB Create a matrix E, using A and B vectors as row 1 and row 2...
MATLAB Create a matrix E, using A and B vectors as row 1 and row 2 respectively A = 10 thru 1 B = 1 thru 4.2 with ten equally spaced elements and Find the indices (row and col) within E where (prob02a, b, c, d) E = 5 E > 4 E < 1.9 E > 1 and E < 2
Arrays, loops, functions: Lotto Element Repeated Function Write a function that that takes as parameters an...
Arrays, loops, functions: Lotto Element Repeated Function Write a function that that takes as parameters an array of ints, an int value named element, and an int value named end. Return a bool based on whether the element appears in the array starting from index 0 and up to but not including the end index. Generate Random Array Write a function that takes as parameters an array of integers and another integer for the size of the array. Create a...