Question
In Matlab
Consider the array A. 10 3 5 -4 12 -5 9 2 A= 6 13 -8 11 115 -5 4 1 Write a program that computes the array B by computing the
0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB code for the given matrix as per specifications

A=[3 5 -4 12; -5 9 10 2; 6 13 -8 11; 15 -4 4 1];

for i=1:4

            for j= 1:4

                if(A(i,j)>10)

                       A(i,j)=A(i,j)^2;

                else

                      A(i,j)=5*A(i,j);

               end

        end

end

---------------------------------

GIven matrix

A = 3 5 -4 12 10 2 -5 6 9 13 -8 11 15 -4 4 1

Result

A = 15 -20 144 25 45 -25 50 10 30 169 -40 121 225 -20 20 5

Add a comment
Know the answer?
Add Answer to:
In Matlab Consider the array A. 10 3 5 -4 12 -5 9 2 A= 6...
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
  • A=[-6,8,2;1,-3,20;15,-10,5]; Write a program that computes the array B by computing the natural logarithm of all...

    A=[-6,8,2;1,-3,20;15,-10,5]; Write a program that computes the array B by computing the natural logarithm of all the elements of A whose value is greater than or equal to 1. Otherwise add 30 to each element that is less than 1. Do this in two way. A) By using a for loop with conditional statements B)By using a logical array as a mask MATLAB CODE

  • In Matlab A= 3 -5 6 ( 15 7 9 13 5 -4 12 10 2...

    In Matlab A= 3 -5 6 ( 15 7 9 13 5 -4 12 10 2 8 11 4 1 For the matrix A in problem-2, use MATLAB to carry out the following instructions a. Find the maximum and minimum values in each column. b. Find the maximum and minimum values in each row. c. Sort each column in ascending order and store the result in an array P. d. Sort each row in descending order and store the result...

  • write a Matlab program ( solve the three questions). please use array and create your own...

    write a Matlab program ( solve the three questions). please use array and create your own function to check primality Question 1 : [10 points) Write a MATLAB program that will store all the first 1000 prime numbers in an array variable named arr_of_primes. Please note that a prime number is a positive integer that is bigger than or equal to 2 which is divisible only by 1 and itself. Examples of the first 8 primes are: 2, 3, 5,...

  • write it in matlab language Question No 4 6 Marks The surface area and volume of...

    write it in matlab language Question No 4 6 Marks The surface area and volume of the shown ring-shaped mechanical part are calculated respectively as follows: A =rd (2k +d) V = *d? (2R +d) Write a user defined function that computes surface area (A) and volume (V) of this ring from the arguments d and R. Suppose that is constrained to be 15 in, greater than d. Write a script file that uses your function to plot A and...

  • 4. (7 pts) Let A be an array of 5 integers, whose contents are as follows:...

    4. (7 pts) Let A be an array of 5 integers, whose contents are as follows: 3, 2, 1, 5, 4. We will apply insertion sort to sort this array. Show all of the element-wise comparisons made by the algorithm in the correct order. Here an element-wise comparison means the comparison of one element of the array with another element of the array or the key set in a particular step of the algorithm. Since the algorithm may move the...

  • In need this in C language! Write a program that declares a 40 element array of...

    In need this in C language! Write a program that declares a 40 element array of type double. Initialize the array so that: the first 10 elements are equal to the square of the index variable the next 10 each elements is equal to three times the index variable the next 10 each element is equal to the sum of an element in the first 10 + an element in the second 10 the last 10 each element is equal...

  • matlab help Write a script to manipulate the array A = [2 1 4 3 6...

    matlab help Write a script to manipulate the array A = [2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19] to be in descending order without using the sort function. You must do everything using array manipulation in MATLAB (i.e. you cannot sort it by hand and then hardcode it, you cannot simply create the array 1:20, you cannot simply add .rej3mat(J-l 1],1,10) to A). Write a script that...

  • Consider the matrix: 15 9 13 2 6 10 14 3 7 11 15 4 8 12 16 a- Find the eigenvectors of this matri...

    Consider the matrix: 15 9 13 2 6 10 14 3 7 11 15 4 8 12 16 a- Find the eigenvectors of this matrix and their corresponding eigenvalues. b-Indicate if there are any degeneracy, and if so, change only one element of this matrix to remove this degeneracy (of course you need to recompute the eigenvalues to show that the degeneracy was lifted). Write a Mathematica program to calculate the roots of the following function f(x) = 0.5*e*-5*x+2 using...

  • 1. (30 Points) Write a MATLAB program that displays "The multiplication of 10 multiplied by integers...

    1. (30 Points) Write a MATLAB program that displays "The multiplication of 10 multiplied by integers of 1 through 15. Display your result back to the user with 2 decimal places (yes, 2 decimal places). You must implement your code using a for loop. The result should have the following format: The multiplication of 10*1 =10.00 The multiplication of 10*2 =20.00 The multiplication of 10'3=30.00 The multiplication of 10*15=150.00 2. (35 Points) Write MATLAB code to prompt a user for...

  • A method called linearSearch(), which takes as parameters an array of int followed by three values...

    A method called linearSearch(), which takes as parameters an array of int followed by three values of type int, and returns a value of type int. The first int parameter represents a key, the second int parameter represents a starting position, and the third int parameter represents an end position. If the key occurs in the array between the start position (inclusive) and the end position (exclusive), the method returns the position of the first occurrence of the key in...

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