Hi Im trying to export the results to Excel that I am getting by fprintf inside a loop, I don't know if I'm to use xlswrite or fopen here is the code
names=["Carlos",'Sara','Sinead','Kai','Ali','Chen','Julia','Tom'];
marks= [23,45,67,90,45,61,14,84];
fprintf('Names \t Marks \t Result \n');
for i = 1:length(marks)
if marks(i) < 39
result = ("Fail");
elseif marks(i) < 69
result = ("Pass");
else
result = ("Distinction");
end
fprintf('%s \t %d \t %s\n',names(i),marks(i),result);
end
so I'd want fprintf('%s \t %d \t %s\n',names(i),marks(i),result); on excel