Download presentation
Presentation is loading. Please wait.
1
Spring 2007 1R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Return HomeworkReturn Homework Class ScheduleClass Schedule Functions: Matlab #4Functions: Matlab #4
2
Spring 2007 2R. 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
3
Spring 2007 3R. 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
4
Spring 2007 4R. 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
5
Spring 2007 5R. 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 http://creativecommons.org/licenses/by- sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.