Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Return HomeworkReturn Homework Class ScheduleClass Schedule Functions: Matlab #4Functions: Matlab #4
Spring R. Smith - University of St Thomas - Minnesota Functions Much like “C” functionsMuch like “C” functions –Input via a parameter list –Output by assigning the result Different from “C”Different from “C” –Syntax is different – no curly braces, no data types… –Can return several results
Spring R. Smith - University of St Thomas - Minnesota Examples WholeAndPart – return fraction separate from wholeWholeAndPart – return fraction separate from whole PowersumPowersum Experiment with AddToEndExperiment with AddToEnd –Option: add to end of vector passed to it –Option: create a new vector with extra data
Spring R. Smith - University of St Thomas - Minnesota Problem 6.10 Compute hours/minutes/seconds from daysCompute hours/minutes/seconds from days Days as a real numberDays as a real number –Fractional part for part of a day Useful functionsUseful functions –Rem –Ceil –Floor Problem SolvingProblem Solving –Separate out the fractional parts –Accumulate the larger parts
Spring R. Smith - University of St Thomas - Minnesota Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.