Unformatted text preview: ned function ‘Num2Ltr’.
Ink or screen grab your code here: LECTURE
Education function [ LetterGrade] = Num2Ltr( numgrade )
% Num2Ltr function which converts a numeric grade to a %
% Only converts to A,B,C,D,F. If an invalid grade
is entered the function returns the letter 'X'.
if numgrade<0 || numgrade>100
end % extra end rarely needed in MATLAB functions Run your function for the following grades:
89.99, 103, 72 Note that NONE of the variable names used by the
function (internally) appear in your workspace.
This is because those variables are LOCAL to the
function. Values are passed to- and from- the
function via their positions in the argument lists. LECTURE
Education On your own…..try adding an ‘averaging algorithm’
to the max/min program to find the average of the
numbers entered……… LECTURE
View Full Document
- Spring '06
- Integers, Max, Prime number