Question
answer 8 using matlab
Using nested loops, traverse through the matrix for the following. a) Replace all elements divisible by 3 with 100. b) Replac
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Solution

8)

1 2 3 4 function [max, occ] - max_ele(A) [rows cols]=size(A); max=A(1,1); for i=1: rows for j=1: cols if Ali, j)>max max=A[i,

---

all the best

Add a comment
Know the answer?
Add Answer to:
answer 8 using matlab Using nested loops, traverse through the matrix for the following. a) Replace...
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
  • Solve using loops in MATLAB provide screenshots id. Matrix Multiplication Matrix Multiplication of an M x...

    Solve using loops in MATLAB provide screenshots id. Matrix Multiplication Matrix Multiplication of an M x P matrix (A) with a P x N matrix (B) yields an M x N matrix (C) with the Matlab command: C=A*B Replicate this result by using three nested loops. Your code should work for any compatible matrices A, B.

  • Matlab ==text only not images== ==correct solution only plz== a) Write a nested for loops to...

    Matlab ==text only not images== ==correct solution only plz== a) Write a nested for loops to test if an input Matrix A is a sparse matrix or not. A sparse matrix is a matrix in which most of the elements are zero. By contrast, if most of the elements are nonzero, then the matrix is considered dense. The number of zero-valued elements divided by the total number of elements is called the sparsity of the matrix, so matrix A will...

  • It is required to write a Matrix Calculator Program using C Programming Language that could only...

    It is required to write a Matrix Calculator Program using C Programming Language that could only perform addition, subtraction, and multiplication of two matrices of appropriate dimensions. Your program should prompt the user to select a matrix operation from a list of options that contains the aforementioned operations. Then, the user should be prompted to enter the dimensions of the two operand matrices. Next, your program should prompt the user to enter the elements of each matrix row-wise. Your program...

  • Problem 3 (20 pts) It is required to write a Matrix Calculator Program using C Programming...

    Problem 3 (20 pts) It is required to write a Matrix Calculator Program using C Programming Language that could only perform addition, subtraction, and multiplication of two matrices of appropriate dimensions. Your program should prompt the user to select a matrix operation from a list of options that contains the aforementioned operations. Then, the user should be prompted to enter the dimensions of the two operand matrices. Next, your program should prompt the user to enter the elements of each...

  • 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...

  • Please code in MatLab or Octave Output should match Sample Output in the second picture Thank...

    Please code in MatLab or Octave Output should match Sample Output in the second picture Thank You 4. In this problem we will investigate using loops to calculate the product of two matrices. Given an mxn matrix A and an n x p matrix B, the matrix product C = AB is the m xp matrix with Cij = R=1 Qikbky. Write a program which calls a function get matrix.dimensions which should • print a description of the purpose of...

  • R programming 1. Write an assignment statement to complete each of the following without using diff()...

    R programming 1. Write an assignment statement to complete each of the following without using diff() and sign(): (a) generate a vector of the difference between the ith element and the (i+1)th element in a vector v of integers, where i = 1: length(v), and (b) generate a vector of the sign of each elements in the vector generated in (a) as follows: ‘p’ for positive, ‘n’ for negative. (Use v ⟵ c(1,4,7,2,1) for testing.) 2. Write a function that...

  • Publish using a MatLab function for the following: If a matrix A has dimension n×n and has n line...

    Publish using a MatLab function for the following: If a matrix A has dimension n×n and has n linearly independent eigenvectors, it is diagonalizable.This means there exists a matrix P such that P^(−1)AP=D, where D is a diagonal matrix whose diagonal entries are made up of the eigenvalues of A. P is constructed by taking the eigenvectors of A and using them as the columns of P. Your task is to write a program (function) that does the following If...

  • Using Python, Can someone please assist in the following: These are the hints: Summary This week's lab is to create a simple multiplication table using nested loops and if statements. Prompt the...

    Using Python, Can someone please assist in the following: These are the hints: Summary This week's lab is to create a simple multiplication table using nested loops and if statements. Prompt the user for the size of the multiplication table (from 2x2 to 10x10). Use a validation loop to display a warning if the number is less than 2 or greater than 10 and prompt the user to enter the data again until they enter a valid number Put a...

  • the picture above is the one you are supposed to use for the MATlab code please...

    the picture above is the one you are supposed to use for the MATlab code please help Problems. Grayscale images are composed of a 2D matrix of light intensities from O (Black) to 255 (White). In this lab you will be using grayscale images and do 2D-array operations along with loops and iflelse branches. 1. We can regard 2D grayscale images as 2D arrays. Now load the provided image of scientists at the Solvay Conference in 1927 using the imread)...

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