Professional Documents
Culture Documents
A=
2 4 6 12 9
-1 2 -3 10 0
12 9 -3 7 10
15 -2 -9 14 -9
2 10 2 3 10
Write down a MATLAB code, which will scan the matrix and eliminates its negative elements. The result
should be the following.
A=
2 4 6 12 9
0 2 0 10 0
12 9 0 7 10
15 0 0 14 0
2 10 2 3 10
Problem – 2
Consider the matrix for Problem – 1. Write down a MATLAB code to count how many 10 there are in
that matrix.
A=
2 4 6 12 9
-1 2 -3 10 0
12 9 -3 7 10
15 -2 -9 14 -9
2 10 2 3 10
Therefore, the output of your code should be: