This preview shows page 1. Sign up to view the full content.
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
This note was uploaded on 01/28/2014 for the course ENGE 1114 taught by Professor Twknott during the Spring '06 term at Virginia Tech.
- Spring '06