Uploaded by Zain Haider

lab 4 task 3

advertisement
a=readmatrix('gametag.xlsx')
a = 10×3
1
2
3
4
5
6
7
8
9
10
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
NaN
68
33
83
89
54
77
39
59
47
61
x=readtable('gametag.xlsx')
Warning: Column headers from the file were modified to make them valid MATLAB identifiers before creating
variable names for the table. The original column headers are saved in the VariableDescriptions property.
Set 'VariableNamingRule' to 'preserve' to use the original column headers as table variable names.
x = 10×3 table
S_no
Name
Marks
1
1 'Max'
68
2
2 'Bailey'
33
3
3 'Blue'
83
4
4 'Bruno'
89
5
5 'Cindra'
54
6
6 'Benny'
77
7
7 'Chase'
39
8
8 'Coco'
59
9
9 'Tyson'
47
10
10 'Oreo'
61
b=a(end,1)
b = 10
c=randi(10,1)
c = 7
d=x(c,:)
d = 1×3 table
S_no
1
Name
7 'Chase'
Marks
39
m=a(c,3)
m = 39
% generating code
1
if 100>=m && m>90
disp("A grade")
elseif 90>=m && m>80
disp("B grade")
elseif 80>=m && m>70
disp("C grade")
elseif 70>=m && m>60
disp("D grade")
else m<=60
disp("F grade")
end
ans = logical
1
F grade
DOCUMENTATION:NIL
2
Download