You are on page 1of 1

Third Homework 2021-2022

(YOUR_FIRST_NAME_Q1) Q1/ Write a MATLAB script to find the number of zero’s in


any 𝑁 × 𝑀 matrix entered by the user.

For example, if the input is [0 1 0 2 0 3 0 4 0]

Output:

the numbers of zeros are 5

(YOUR_FIRST_NAME_Q2) Q2/ Write a MATLAB script to find the sum and the number
of the even and odd numbers in a 𝑁 × 𝑀 matrix entered by the user.

1 2 3 4
For example, if the input is [ ]
5 5 5 5

Output:

The number of odd number is 6 and the sum of odd number is 24


The number of even number is 2 and the sum of even number is 6

(YOUR_FIRST_NAME_Q3) Q3/ Write a MATLAB script to find the sum and the number
of the odd negative numbers in a 𝑁 × 𝑀 matrix entered by user.

−8 −7 −6 −5
For example, if the input is [−1 −2 −3 −4]
1 2 3 4

Output:

The number of odd negative number is 4


The sum of odd negative number is equal to -16

(YOUR_FIRST_NAME_Q4) Q4/ Write a MATLAB script to find the multiplies of the even
numbers of any 𝑁 × 𝑀 matrix entered by the user.

−8 −7 −6 −5
For example, if the input is [−1 −2 −3 −4]
1 2 3 4

Output:

The multiplies of even number is equal to 3072

You might also like