IsmailJameel
IsmailJameel IsmailJameel
  • 07-07-2020
  • Computers and Technology
contestada

Suppose B = [1, 2 3; 4, 5,6; 7,8,9], write a program with “for” loops that

calculate the square of B.

in MATLAB​

Respuesta :

ronhagrid310
ronhagrid310 ronhagrid310
  • 07-07-2020

Answer:

You don't really need the for loop to calculate B square.

The element-wise multiplication operator can help you get the square of each element of B.

B = [1, 2 3; 4, 5,6; 7,8,9];

B = B.^2;

Hope this helps!

Answer Link

Otras preguntas

you hav designed a picture that is shaped as a square. the dimensions of your picture  are 6x6in. you want to make it into a poster with dimensions 13x13in. the
what is aas congruence?
What are the sides of the DNA ladder made of?
What did the Egyptians call the area that we now call Sudan?
what is aas congruence?
determine whether the system of linear equations has one and only one solution, infinitely many solutions, or no solution. Find all solutions whenever they exis
Find the LCM of 8,9, and 12
What did the Egyptians call the area that we now call Sudan?
Find the LCM of 8,9, and 12
What are the sides of the DNA ladder made of?