Hello. There is such a problem:
Given a square matrix of order N. In the matrix, calculate the arithmetic average of positive elements on the main diagonal.
I thought about it, and decided to do so ... Set an array, then calculate the positive elements. Then move them to a new array and calculate the amount of gender. elements standing on the main diagonal ...
How can I transfer the positive elements to a new array? Need to create a new variable or is there another way?
Thank you in advance!