Info
This question is closed. Reopen it to edit or answer.
Can any1 give some hints for this thanks
2 views (last 30 days)
Show older comments
I have figured out how to round random numbers to nearest specific numbers. But i can't seem to figure out how to load a file with grades and then do the rounding, instead of creating random grades myself and then do the rounding?
My function looks like this atm:
function gradesRounded = roundGrade(grades)
%data0=load(filename);
A = readtable('grades');
gradeskala = [-3 0 2 7 10 12];
N = [0.1 2.2 1.6 7.3 10 -1.5];
NRounded = interp1(gradeskala,gradeskala,N,'nearest')
end
The task is this:
%
0 Comments
Answers (1)
Image Analyst
on 19 Jan 2015
Do File->New. Then type in a bunch of numbers and save it to a disk file. then read it in with something like dlmread() or importdata().
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!