ECE201 - Lab Sheet 10 (2) 2
ECE201 - Lab Sheet 10 (2) 2
1. Write a MATLAB program to find the average of ten students’ marks by using
for loop.
Steps:
1. Start by defining an array named marks with 10 elements, each representing a student's mark.
2. Use a for loop to go through each student's mark in the array.
3. After the loop, calculate the average.
4. Finally, display the average using the fprintf function with two decimal places.
Code:
Output:
Electrical Engineering Department قسم الهندسة الكهربائية
Function code:
Output:
Electrical Engineering Department قسم الهندسة الكهربائية
Function code:
Output: