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
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.
*** 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: Write a function called matrix_problem1 that takes a matrix A of positive integers as its...
MATLAB: Write a function called matrix_problem1 that takes a matrix A of positive integers as its sole input. If the assumption is wrong, the function returns an empty matrix. Otherwise, the function doubles every odd element of A and returns the resulting matrix. Notice that the output matrix will have all even elements. For example, the call B = matrix_problem([1 4; 5 2; 3 1], will make B equal to [2 4; 10 2; 6 2]. The function should work...
c) A function named tallied_data() that takes in a nested list (Use this on the data...
c) A function named tallied_data() that takes in a nested list (Use this on the data from part 1, but it should be able to be used to solve similar problems), indices for two columns and returns a tallied list. The inputs are: i) a nested list, ii) an index for the ‘reference column’/ ‘category’ (col_ref) iii) another index for the column to be tallied (col_tally) iv) this function returns a list of tuples where each element is a tuple...
Q) a) create a matrix named as X of evenly spaced values from 0 to 50,...
Q) a) create a matrix named as X of evenly spaced values from 0 to 50, with an increment of 10. b) a) create a matrix named as Y of evenly spaced values from 500 to 1000, with an increment of 3. c)a) create a matrix named as Z, the value of the 1st row is from 1 to 10, 2nd row from 2 to 20 with increment of 2, 3rd row 3 to 12. using subplot divide the window...
3. Create vector V of integers randomly distributed on [-10 20] .display the vector. a) Use...
3. Create vector V of integers randomly distributed on [-10 20] .display the vector. a) Use for-end loop to examine each element of the vector. If element is positive double its value ; if element is negative triple its value. Display the result. b) without using for loop find number of elements in V that are greater than 1 c) without using for loop find all of elements in V that are greater or equal to -7 and are less...
1-Create a week_tuple and assign the days of the week as strings to the week_tuple. b....
1-Create a week_tuple and assign the days of the week as strings to the week_tuple. b. Print out the elements in the week_tuple. 2-a. The following list has been declared as follows: credit_list = [24,3,15] b. Convert the credit_list to a tuple named credit_tuple. c. Print out the elements in the credit_tuple. 3-a. Write an initialize_list_values function that takes in a number for the number of elements in a list and an initial value for each element. The function creates...