Can any1 give some hints for this thanks

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:
%

Answers (1)

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().

This question is closed.

Tags

Asked:

Sun
on 19 Jan 2015

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!