You are on page 1of 1

clc;

clear;

a=xlsread('C:\Users\Prabal\Desktop\datasheet.xlsx','Sheet1');

fprintf('STUDENT DATASHEET has been stored successfully!\n\n');

b=a(:,1);

c=length(b);

fprintf('The following roll numbers are present in the STUDENT DATASHEET:\n\n');

for i=1:c
fprintf('ROLL NUMBER: %d\n', b(i));
end

fprintf('\n\nMarks in which subject(against the above roll numbers) do you want to


extract?\n');

d=input('Enter 1 for subject A, 2 for subject B, 3 for subject C: ');

if d==1; r='Subject A' ; end


if d==2; r='Subject B' ; end
if d==3; r='Subject C'; end

e=d+1;

f=a(:,e);

fprintf('\n\n');

fprintf('Marks in %s (against the above roll numbers) are as follows: \n\n', r);

for i=1:c
fprintf('ROLL NUMBER: %d ----> MARKS: %d \n', b(i), f(i) );
end

fprintf('\n\n');

g=input('Enter the roll number against which marks of the subjects are to be
extracted: ');

h=0;

for i=1:c

if g==b(i) ; h=i ; end

end

k=a(h,:);

fprintf('\nFor roll number: %d, marks obtained in the subjects are as follows:\
nSubject A ---> %d\nSubject B ---> %d\nSubject C ---> %d\n',g, k(2), k(3), k(4) );

You might also like