How to calculate GPA in row Matrix and using For loop?
조회 수: 2 (최근 30일)
이전 댓글 표시
How to calculate GPA in row Matrix and using For loop in MATLAB?
댓글 수: 1
Dyuman Joshi
2022년 6월 5일
What have you tried yet? What does the data look like? What is the method to calculate GPA?
답변 (1개)
Maneet Kaur Bagga
2022년 7월 5일
As per my understanding you want to calculate the Grade Point Average of a row matrix using for loop. Assuming the method for calculating the GPA is taking out the mean of the given data and returning it as the final result. You can refer to the code below for reference. Hope it helps!
x = [2,5,9,8,7.5,4.9]
len = length(x)
sum=0
for(i=1:len)
sum = sum + x(i)
end
sum = sum/len
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!