CS 107 - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

CS 107

Description:

Thursday 4-5? Or 5-6? Recitation. Lecture Hour: T, Th, 6:40 PM 8:00 PM ... Section 2: Thursday's recitation: 8:25-9:20 PM. Homework and Projects. Homework: ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 14
Provided by: rciRu
Category:

less

Transcript and Presenter's Notes

Title: CS 107


1
CS 107
  • Recitation 1
  • Lu Han

2
General
  • Lu Han
  • luhan_at_cs.rutgers.edu
  • Class webpage
  • Old class webpage http//remus.rutgers.edu/cs107/
  • Recitation http//rci.rutgers.edu/luhan/cs107.ht
    ml
  • Remote MATLAB using Cygwin http//remus.rutgers.e
    du/cs107/cygwin/remote_matlab.htm
  • Office Hour
  • Core 333
  • Thursday 4-5? Or 5-6?

3
Recitation
  • Lecture Hour
  • T, Th, 640 PM 800 PM
  • Recitation Hour
  • Section 1 Tuesdays recitation 825-920 PM
  • Section 2 Thursdays recitation 825-920 PM

4
Homework and Projects
  • Homework
  • Should be submitted using Sakai system
    http//sakai.rutgers.edu/
  • Projects

5
Course policies
  • Grading
  • Homework 10
  • Midterm 1 25
  • Midterm 2 25
  • Final 40
  • Option 1
  • HW/Projects 40
  • Midterm1 15
  • Midterm215
  • Final30
  • Option 2
  • HW/Projects 50
  • Midterm1 15
  • Midterm215
  • Final20

6
What we will do in the recitation
  • Review of material that was covered during the
    lectures
  • Practice Problems
  • To prepare you for approaching assignments and
    tests
  • Discuss the Homework
  • Review homework and midterms
  • Some of the solutions will be given and discussed
    during recitations
  • Answering your questions.

7
Material Covered
  • Basic, but essential elements in Matlab
  • Operations
  • , -, , /.
  • Variables
  • Assignments
  • Instructions
  • M-files
  • Functions

8
Variables and assignment
  • Variable
  • is a way to store a value (or values) in a
    program, and gives the value a name.
  • a place in the computer to store a piece of data
  • Naming a variable (rules)
  • Start with a letter
  • Continue with any combination of letters, numbers
    and _ (underscore)
  • Names are case-sensitive! (Result can hold a
    different value than result)
  • Try to give it a meaning
  • Assignment statements
  • nine 9
  • My_name Lu
  • e8een nine 2

9
An example
  • The difference between math assignment and MATLAB
    (computer language) assignment
  • a a 1

10
Functions
  • When we want a set of operations to run as a
    black box and return some results.
  • Function
  • First line is
  • function output_parameter_list
    function_name(input_parameter_list)
  • Create an M-file with the same name as the
    function you wish to create (e.g.edit
    my_function).
  • Save the file as filename.m
  • Call the function with the right parameters.

11
MATLAB/programming Things
  • MATALB programming essentials can be applied to
    any programming language.
  • Can be graphical (ex. plot())
  • Easier to understand the material
  • Easier to explain material to others
  • How to get usage information?
  • gtgt help, gtgthelp plot
  • Cleaning up variables
  • Clear
  • Quit MATLAB
  • gtgtquit, gtgtexit

12
Exercises
  • Ex 1 Write a function that takes two numbers as
    arguments and returns their sum up.
  • Returns number1 number 2
  • Ex 2 Write a function that takes three numbers
    as arguments and returns their sum up, but you
    have to use the function in ex 1.
  • Ex 3 Write a function to display Hello World

13
Thank you!
  • Any questions?
Write a Comment
User Comments (0)
About PowerShow.com