MATLAB Answers

Need help displaying an output file for data.

3 views (last 30 days)
I have to write a MATLAB script (code) that reads an input file containing all the scores of 30 students and assign them their letter grade. I already have everything set up to give the correct letter grade i just need to open a new file to display it on.
This is what I have...
grade= xlsread('gradesexcel');
data.grade = discretize(grade,...
[.50, .60, .70, .80, .90, 1.00],...
'categorical',...
{'F','D','C','B','A'});
thank you

  0 Comments

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 13 Dec 2019
I have no idea what you want to do.
However if you create a table of your results, writetable could do what you want.

  4 Comments

Show 1 older comment
Star Strider
Star Strider on 13 Dec 2019
My pleasure.
The writetable option should work, since it allows you to include column labels, and if you want, row labels. You can write it as a text file that should allow you to print it without using other functions.
See the documentation on writetable (that I linked to in my Answer) to explore the options it offers.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!