Question

In MATLAB: Without using a function, create a 6 by 6 matrix containing zeros in all...

In MATLAB: Without using a function, create a 6 by 6 matrix containing zeros in all entries except for the first row, first column, and main diagonal (which are random integers between 10 and 100).

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

Matlab code for printing random no in first row, first column, and main diagonal between 10 and 100

and zeros at all other position

MATLAB CODE

arrowhead = zeros(6,6)
for i = 1:6
for j = 1:6
if i==1 || j==1 || i==j
arrowhead(i,j) = randi([10,100])
end
end
end

Add a comment
Know the answer?
Add Answer to:
In MATLAB: Without using a function, create a 6 by 6 matrix containing zeros in 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
  • python Create an empty list of size 100 × 200 with all zeroes. How do you...

    python Create an empty list of size 100 × 200 with all zeroes. How do you access the 4th row and 2nd column of a 2D list called Write a function called printList that takes as a parameter a 2D list and prints it to screen in row/column format. Create a multiplication table of size 10 × 10 that has all the products from 1 times 1 all the way up to 10 times 10. Create a 2D list (matrix)...

  • Can someone help me to solve it by Matlab? 7. Create a 5 row, 8 col...

    Can someone help me to solve it by Matlab? 7. Create a 5 row, 8 col matrix called mymat w ith random integers betwee n and including 70 and 90 Create a matrix from mymat called newmat whose entries consist of those entries which are both in the second and third rows, but also in the 4th through 6th columns 8. 9 What command would you type to list just the 4th row, 6th column entry of mymat? 1o. Crete...

  • MATLAB QUESTION !!! PLEASE USE MATLAB FOR BOTH QUESTIONS!!! THANKS 3) Below is a matrix of...

    MATLAB QUESTION !!! PLEASE USE MATLAB FOR BOTH QUESTIONS!!! THANKS 3) Below is a matrix of random numbers. Find the mean, median, and mode of the matrix. B=[0 1 2 3 4 50689 23092 6 8 407] Sort Matrix Z so that the largest numbers of each row are in the first column and smallest numbers descend towards the last column. Must use sort function. 4) Create a matrix X so that the first row has values from 0 to...

  • on matlab (1) Matrices are entered row-wise. Row commas. Enter 1 2 3 (2) Element A,...

    on matlab (1) Matrices are entered row-wise. Row commas. Enter 1 2 3 (2) Element A, of matrix A is accesser (3) Correcting an entry is easy to (4) Any submatrix of Ais obtained by d row wise. Rows are separated by semicolons and columns are separated by spaces ner A l 23:45 6. B and hit the return/enter kry matrix A is accessed as A Enter and hit the returnerter key an entry is easy through indesine Enter 19...

  • what is a good matlab code to out put this matrix from question 1 to 3...

    what is a good matlab code to out put this matrix from question 1 to 3 HITA 1)-The general form cf the quadratic equation is a +bx+c 0 Wrte a MATLAB function named quadratic that finds the two roots of this equation and x when given the coeficients a, b and c 2)-Create a random matrix A in MATLAB with 6 rows and 3 oolumns using the rand) function 3)-Now modify quadratic by so that il can take each row...

  • In Exercises 1-6, use elementary column operations to create zeros in the last two entries in...

    In Exercises 1-6, use elementary column operations to create zeros in the last two entries in the first row and then calculate the determinant of the original matrix... 1. 1 0 1 1 - 1 1

  • using matlab(applied numerical) 7. (5 points) Create a 4x6 matrix of random integers, each in the...

    using matlab(applied numerical) 7. (5 points) Create a 4x6 matrix of random integers, each in the range from -5 to 5; store it in a variable, ΥΧ. (a) Find the absolute value of rx. (b) Find the smallest and highest numbers in rx. (c) Find the sum of the row and sum of the columns of rx. Hint: use abs, min, max, and sum. 7. (5 points) Create a 4 x 6 matrix of random integers, each in the range...

  • How do I solve using Matlab? Create a matrix X so that the first row has...

    How do I solve using Matlab? Create a matrix X so that the first row has values from 0 to 50 (default intervals), and the second row has values from 50 to 100. Let matrix Y equal to x10 and Z equal to x + y2 Create 4 subplots containing a mesh, surface, 3-Dimensional, and a surface-contour plot. Label with appropriate titles and labels. The plots should have a string look to them.

  • using matlab Create the following matrix B. [18 17 16 15 14 13] 12 11 10...

    using matlab Create the following matrix B. [18 17 16 15 14 13] 12 11 10 9 8 7 6 5 4 3 2 1 Use the matrix B to: (a) Create a six-element column vector named va that contains the elements of the second and fifth columns of B. (6) Create a seven-element column vector named vb that contains elements 3 through 6 of the third row of B and the elements of the second column of B. Create...

  • Please answer through MATLAB and show WHOLE script. 1. An n x n matrix is said...

    Please answer through MATLAB and show WHOLE script. 1. An n x n matrix is said to be diagonally dominant if , lail for i = 1,...,n ji Basically, if for every row, the absolute value of the entry along the main diagonal is larger than the sum of the absolute values of all other entries on that row. Write a function whose input is a matrix and will determine (true/false) if a matrix is diagonally dominant. Show that your...

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