total marks and percentage in marksheet of excelfile

5 views (last 30 days)
mudassir tariq
mudassir tariq on 29 Dec 2021
Commented: KSSV on 29 Dec 2021
roll no names sub1 sub2 sub3 sub4 total marks percentage
1 abc 50 60 70 80
2 def 60 70 80 90
3 ghi 90 50 60 75
i have given this type of excel file how do i get the total marks and percentage of each student using matlab and write data in excel file

Answers (1)

KSSV
KSSV on 29 Dec 2021
Edited: KSSV on 29 Dec 2021
T = readtable(myexcelfile) ;
marks = table2array(T(:,3:6)) ;
total_marks = sum(marks)/400 ; % four subjects each 100 marks
percentage = total_marks*100 ;
T1 = table(total_marks,percentage) ;
T = [T T1]
  6 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!