March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class Quiz RecapQuiz Recap Exam ReviewExam Review C MaterialC Material Matlab MaterialMatlab.

Slides:



Advertisements
Similar presentations
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Tomorrow’s ExamTomorrow’s Exam Today’s LabToday’s Lab SortingSorting.
Advertisements

March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class ProjectsProjects 2 dimensional arrays2 dimensional arrays Higher dimensionsHigher.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Lab 16Lab 16 Filling in an arrayFilling in an array Searching for a.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class More about FunctionsMore about Functions RecursionRecursion.
March R. Smith - University of St Thomas - Minnesota Today’s Class Recap of a simple programRecap of a simple program A “history” of CA “history”
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class IF StatementIF Statement Revisiting assignment statementsRevisiting.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Hard Drives – more laterHard Drives – more later MethodsMethods.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam TopicsExam Topics.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class The project assignment, againThe project assignment, again Arrays.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Functions and Array ArgumentsFunctions and Array Arguments ExamExam.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Today: covering through P. 83 of textToday: covering through P. 83 of.
March R. Smith - University of St Thomas - Minnesota Today’s Class Course StuffCourse Stuff –Classroom change TOMORROW –Assignment; Lab While LoopsWhile.
March R. Smith - University of St Thomas - Minnesota Today’s Class Program LayoutProgram Layout Problem SolvingProblem Solving Reading InputReading.
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class Class on Wednesday – “Lab time” in OSS 230Class on Wednesday – “Lab.
March R. Smith - University of St Thomas - Minnesota Today’s Class RecapRecap More course thingsMore course things Work on labs/projectsWork on labs/projects.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class GradingGrading The examThe exam Sorting arraysSorting arrays Pointers,
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Where we areWhere we are Strings and TextStrings and Text ConditionalsConditionals.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Final Exam ReviewFinal Exam Review –Assessment –Exam Format –C –Matlab.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam StatusExam Status Recap of Lab 7 ExampleRecap of Lab 7 Example.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class I/O ObjectsI/O Objects Lab 12Lab 12.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Young Scholars GrantsYoung Scholars Grants Exam Next TuesdayExam Next.
March R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Today’s LabToday’s Lab SortingSorting.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class End of Chapter 2: READ Section 2.15End of Chapter 2: READ Section.
March R. Smith - University of St Thomas - Minnesota CISC Class Today Return Homework; grading recapReturn Homework; grading recap “Enigma”
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Class projectsClass projects Lab 13: Use the method documentation.
6/22/2015 1R. Smith - University of St Thomas - Minnesota QMCS Class Today St. Lukes Case StudySt. Lukes Case Study.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Return HomeworkReturn Homework Class ScheduleClass Schedule Functions:
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Exam ReviewExam Review Arithmetic - I think everyone gets thisArithmetic.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Upcoming Exam – April 8Upcoming Exam – April 8 Structures ReviewStructures.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class The examThe exam Hierarchy of FunctionsHierarchy of Functions Solving.
March R. Smith - University of St Thomas - Minnesota QMCS Class Today Cryptography – introductory termsCryptography – introductory terms “Enigma”
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class RecapRecap Functions and CFunctions and C Using FunctionsUsing Functions.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class MethodsMethods Problem solving by decompositionProblem solving by.
March R. Smith - University of St Thomas - Minnesota Today’s Class Lab 1 commentsLab 1 comments Data Types in Chapter 4Data Types in Chapter 4 Lab.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Nested IFNested IF “Boolean” Logical Operations“Boolean” Logical.
March R. Smith - University of St Thomas - Minnesota Today’s Class First, course surveysFirst, course surveys RecapRecap More course thingsMore course.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Lab Status, Paper StatusLab Status, Paper Status Comments on Ints vs.
6/28/2015 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class History Paper recapHistory Paper recap Finish the movieFinish the movie.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Data IndependenceData Independence Matlab #3: Exercise 5.1Matlab #3:
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class StatusStatus –Survey –Returning homework ArraysArrays –What are they?
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Finish up Lab 13Finish up Lab 13 Lab 14 – DetailsLab 14 – Details.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class The examThe exam –Open book, no notes, like last time Exam TopicsExam.
March R. Smith - University of St Thomas - Minnesota Today’s Class Class StuffClass Stuff ProjectProject Vectors and DimensionsVectors and Dimensions.
March R. Smith - University of St Thomas - Minnesota Today’s Class Office hours canceled todayOffice hours canceled today RecapRecap Matlab ProgrammingMatlab.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Matlab “Matrix Laboratory”Matlab “Matrix Laboratory” Chapter 1 – matrices.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class About HomeworkAbout Homework Increment/DecrementIncrement/Decrement.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Homework & GradesHomework & Grades Multiple DimensionsMultiple Dimensions.
March R. Smith - University of St Thomas - Minnesota Today’s Class Homework NotesHomework Notes –Always try to match the printed output if I give.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Change in order of topicsChange in order of topics –Starting Chapter.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class More LoopsMore Loops Do While – a ‘trailing decision’ loopDo While.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class The ExamThe Exam Homework NotesHomework Notes.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class AssignmentsAssignments Logical operationsLogical operations Summations.
March R. Smith - University of St Thomas - Minnesota Today’s Class RecapRecap Schedule for rest of classesSchedule for rest of classes Matlab Functions.
9/21/2015 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class RecapRecap Files, writing filesFiles, writing files 1D Array Recap1D.
1 Functions 1 Parameter, 1 Return-Value 1. The problem 2. Recall the layout 3. Create the definition 4. "Flow" of data 5. Testing 6. Projects 1 and 2.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Final Exam – rest of class scheduleFinal Exam – rest of class schedule.
5/27/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class RecapRecap Drawing in 2 dimensionsDrawing in 2 dimensions Vertical HistogramVertical.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Grades & Lab 12Grades & Lab 12 Upcoming ExamUpcoming Exam StructuresStructures.
March R. Smith - University of St Thomas - Minnesota QMCS Class Today “Enigma” recap and finish“Enigma” recap and finish The quiz/surveyThe.
1 Printing in Python Every program needs to do some output This is usually to the screen (shell window) Later we’ll see graphics windows and external files.
1/7/2016 1R. Smith - University of St Thomas - Minnesota Today’s Class Mostly Lab TimeMostly Lab Time How to use shared foldersHow to use shared folders.
1/28/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Assignments 7 and 8Assignments 7 and 8 ExamExam History Paper AssignmentHistory.
1/31/2016 1R. Smith - University of St Thomas - Minnesota CISC Today’s Class RecapRecap Problem 11Problem 11 Problem 12Problem 12.
2/22/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class History Paper scheduleHistory Paper schedule RecapRecap Plus PlusPlus.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class What’s on the Exam Next Week?What’s on the Exam Next Week? Lab 8Lab.
March R. Smith - University of St Thomas - Minnesota Today’s Class Class StuffClass Stuff ProjectProject Vectors and DimensionsVectors and Dimensions.
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Collect PapersCollect Papers Review: Our ZeroesReview: Our Zeroes Review:
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Computer HardwareComputer Hardware Recap: next programRecap: next program.
7/7/2016 1R. Smith - University of St Thomas - Minnesota CISC Today’s Class RecapRecap Project ProposalProject Proposal Problem 12Problem 12 Final.
Presentation transcript:

March R. Smith - University of St Thomas - Minnesota Today’s Class Quiz RecapQuiz Recap Exam ReviewExam Review C MaterialC Material Matlab MaterialMatlab Material Why C? Why Matlab?Why C? Why Matlab?

March R. Smith - University of St Thomas - Minnesota Quiz Recap: Functions in C Functions have a HEADERFunctions have a HEADER –The header gives the type, the name, and the argument list –You need the header and the curly braces around the whole thing. Functions get inputs from ARGUMENTSFunctions get inputs from ARGUMENTS Functions send results through RESULTFunctions send results through RESULT –A ‘void’ function returns NO result Side Effects: ONLY if there’s I/O, or changes an ARGUMENTSide Effects: ONLY if there’s I/O, or changes an ARGUMENT

March R. Smith - University of St Thomas - Minnesota Final Exam – WHEN? Where? Here.Where? Here. When? …When? …

March R. Smith - University of St Thomas - Minnesota Final Exam – Section 2 (Morning) After Thursday, contact Oliver about examsAfter Thursday, contact Oliver about exams Section 2 (Morning) Exam:Section 2 (Morning) Exam: –Wednesday Dec 17 –8:00-10:00 AM

March R. Smith - University of St Thomas - Minnesota Final Exam – Section 3 (Afternoon) After Thursday, contact Oliver about examsAfter Thursday, contact Oliver about exams Section 3 (Afternoon) Exam:Section 3 (Afternoon) Exam: –Tuesday Dec 16 –1:30-3:30 PM

March R. Smith - University of St Thomas - Minnesota What is on the exam? Writing functions in CWriting functions in C Writing functions in MatlabWriting functions in Matlab Doing the same things in bothDoing the same things in both –I.e. 1 dimensional vectors and 1 dimensional arrays A loop and some IF statementsA loop and some IF statements –Solving problems with summations –Dealing with character codes and text Explaining why one might be better than the other for a particular problemExplaining why one might be better than the other for a particular problem

March R. Smith - University of St Thomas - Minnesota Looking at the Cheat Sheet Studying: you should know how to use EVERYTHING on the Cheat Sheet.Studying: you should know how to use EVERYTHING on the Cheat Sheet. C MatlabMatlab SummationsSummations Function FormatsFunction Formats Other SyntaxOther Syntax

March R. Smith - University of St Thomas - Minnesota Sum of integers 1 through N int sumi (int n) { int i;// index for the for loop int t;// total of the sum t = 0; for (i = 1; i <= n; i++) { t = t + i; } return t; }

March R. Smith - University of St Thomas - Minnesota Sum of a vector K with N elements int sumk (int k[], int n) { int i;// index for the for loop int t;// total of the sum t = 0; for (i = 0; i < n; i++) { t = t + k[i]; } return t; }

March R. Smith - University of St Thomas - Minnesota Exam Strategy If you don’t know what to doIf you don’t know what to do –Look at the Cheat Sheet –Find something about the problem Once you’ve answered a problemOnce you’ve answered a problem –Look up the specifics on the Cheat Sheet –Be sure you got the syntax correct –Be sure you used the right operators and functions Use “=“ for assignment. Use “==“ for ‘if’ and ‘while’Use “=“ for assignment. Use “==“ for ‘if’ and ‘while’

March R. Smith - University of St Thomas - Minnesota Matlab Functions Syntax:Syntax: function answer = name ( arguments ) % comment on how to use it statements ; File name.m must match function nameFile name.m must match function name List of zero or more arguments separated by commasList of zero or more arguments separated by commas Must set answer to legitimate valueMust set answer to legitimate value Executes statements till the end of the function fileExecutes statements till the end of the function file Exam will have ‘single result’ functions (like C)Exam will have ‘single result’ functions (like C)

March R. Smith - University of St Thomas - Minnesota Matlab IF/Else Typical Syntax:Typical Syntax: if ( expression1 ) statement1 ; elseif ( expression2 ) statement2 ; else statement3 ; end ALWAYS needs the end statement to mark the endALWAYS needs the end statement to mark the end No curly bracesNo curly braces

March R. Smith - University of St Thomas - Minnesota Matlab FOR Syntax:Syntax: for variable = vector statements ; end Goes through vector, element by elementGoes through vector, element by element –Assigns an element to variable –The vector can be a colon statement, like 1:length(x) Runs the statements until end, then repeatsRuns the statements until end, then repeats ALWAYS needs the end statement to mark the endALWAYS needs the end statement to mark the end No curly bracesNo curly braces

March R. Smith - University of St Thomas - Minnesota Matlab WHILE Syntax:Syntax: while expression statements ; end Tests expression for non-zero result, loops if soTests expression for non-zero result, loops if so Runs the statements until end, then repeatsRuns the statements until end, then repeats ALWAYS needs the end statement to mark the endALWAYS needs the end statement to mark the end No curly bracesNo curly braces

March R. Smith - University of St Thomas - Minnesota Why C? Why Matlab? The exam will ask you to explain why it’s better to use one or the other for various problemsThe exam will ask you to explain why it’s better to use one or the other for various problems

March R. Smith - University of St Thomas - Minnesota Choosing between C and Matlab Matlab is Better for…Matlab is Better for… Vector and matrix mathVector and matrix math –When sizes aren’t known ahead of time –When sizes might vary from one vector to another Graphing – it’s built inGraphing – it’s built in Processing standard file formats – built inProcessing standard file formats – built in –Images and spreadsheets C is Better for… Group programming –Established ways of sharing the work Tight quarters –When the computer is too small to run Matlab Little or no OS support –Computer doesn’t have graphics, not very interactive Access to I/O hardware –Easy to manipulate I/O control registers from C

March 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.