What are you trying to ask...
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!
<span>The four kinds of information a writer must document are: summary of a discussion, original ideas, common knowledge information, and direct quotation. These are the fundamental information one must seek in order to fully understand the document.</span>