Introduction to Programming in MATLAB

Slides:



Advertisements
Similar presentations
Introducing DFA Formal Description Using Peer Instruction Cynthia Bailey Lee UCSD 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia.
Advertisements

A spreadsheet is like a big table. It contains rows and columns which work together. Left-click to go to the next slide.
CSS The basics { }. CSS Cascading Style Sheets - language used to – describe html appearance & formatting Style Sheet - file that describes – how html.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
© red ©
Contains 16,777,216 Colors. My Car is red My Car is red How do I add colors to my web page? Notepad Browser Works with the “Standard” colors: Red, Green,
Getting Started with HTML Please use speaker notes for additional information!
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Two –Dimensional Arrays Mrs. C. Furman Java Programming November 19, 2008.
Lecture 15: Intro to Graphics Yoni Fridman 7/25/01 7/25/01.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Digital Media Lecture 4.1: Image Encoding Practice Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
Homework Assignment You are going to research any artist of your choosing from any time period or genre. You are going to complete a one page double- spaced.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Which formula gives you the desired effect? Desired Results ABCD Click on the letter of the correct answer. A is incorrect. The sidebar and main have the.
CS106X – Programming Abstractions in C++ Cynthia Bailey Lee Dijkstra’s animation slides by Keith Schwarz CS2 in C++ Peer Instruction Materials by Cynthia.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Ready, SET, go! By Melissa Dalis Professor Susan Rodger Duke University July 2011.
PART TWO Electronic Color & RGB values 1. Electronic Color Computer Monitors: Use light in 3 colors to create images on the screen Monitors use RED, GREEN,
Building Your Own Number Line. Step 1: Fold your strip in half.
Licensed under Creative Commons Attribution – ShareAlike 4.0 International Building Slide Decks.
Digital Media Lecture 4.2: Image Encoding Practice Georgia Gwinnett College School of Science and Technology Dr. Jim Rowan.
Supplies:  composition notebook  markers and/or colored pencils  3x5 index cards (200 total)  scotch tape  glue stick  Optional: sticky notes.
What is accessible information? On the next slide we will show you a few examples. It is information that everyone can understand.
What colour?.
11 October Building a Web Site.
Introduction to Programming in MATLAB
Basic cookery terms are identified correctly
Watch Pete the Cat here:
Digital Media Lecture 4.1: Image Encoding Practice
Introduction to Programming in MATLAB
By Sanjay and Arvind Seshan
CSSE463: Image Recognition
CSSE463: Image Recognition
Choice 1 Choice 2 Choice 3 Choice 4
What is accessible information? It is information that everyone can understand. On the next slide we will show you a few examples.
Determining Sample Size
Plate Identification of Great Britain Penny Red
Getting Started with Early Algebra
Solving the Rubik’s® 2x2 Cube
What do these words mean to you?
“Coding” for the building blocks of our bodies Edited
The YELLOW Face Lesson 5: The Yellow Face Lesson 5.
PRESENTATION LAYOUTS This is a title slide
The RGB LED.
Text Each slide has a different corner that is the correct answer.
- orange white green - cyan - red - blue Example 1 24 bit RGB
Lesson 3: Finding Lines On The Mat
Align The Stars Continue.
BEGINNER PROGRAMMING LESSON
Colors Computers build colors from Red, Green, and Blue; not Red, Blue, and Yellow. RGB = Red Green Blue Creating Colors Red + Blue = Purple No Red, No.
What Color is it?.
Instructions The first time you open this template, immediately save the file by another name as a PowerPoint Presentation (.pptx), not as a PowerPoint.
Introduction to Programming in MATLAB
Align The Stars Continue.
Non-numeric Data Representation
Directions: Fill in the blanks with the correct answers then color in the picture with the given color. Color White: A full rotation around a.
how organisms relate to each other and their environment
The Colors of Our World Mary Kate DeLary.
One of these things is not like the other
- orange white green - cyan - red - blue Example 1 24 bit RGB
One of these things is not like the other
One of these things is not like the other
Solving the Rubik’s® 2x2 Cube
A step by step instruction guide
Creating Combinations
Presentation transcript:

Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at www.peerinstruction4cs.org.

Which image results from the following code segment: >> im = imread('rainbow.jpg'); >> part = im(1:floor(end/2),1:end,:); >> imshow(part) a) c) C **Be sure to explain what”floor” means—this is likely first time they’ve seen it (a)(b) misc. distractors (c) Correct. Top half of the rows, all the columns. Emphasize that while there is a lot more text now in the three index locations (row,col,layer), we break it down by separating with the *commas* (d) Confuses row/col index b) d) e) None/other/error

Which image results from the following code segment: >> im = imread('rainbow.jpg'); >> part = im(1:floor(end/2),floor(end/2)+1:end,:); >> imshow(part) a) c) A Correct – Top half of the rows and right half of the columns. Students will wonder what the +1 is for—this is just so that 1:floor(end/2) and floor(end/2)+1:end select non-overlapping sets of rows or columns, as the case may be. This doesn’t matter so much for this question, but we did a homework assignment where it mattered. Confuses row/col index (d) arbitrary distractors b) d) e) None/other/error

Which image results from the following code segment: RGB color reference Which image results from the following code segment: >> im = imread('rainbow.jpg'); >> im(1:floor(end/2),1:floor(end/2),1) = 0; >> imshow(im) a) c) D Correct color, wrong location. Correct location, wrong color. Incorrect Correct. Notice in the reference that blue and green maxed out, with no red, gives teal—so the white areas of the image are turned teal with the removal of red. Also notice that the red stripe as gone completely black, while the blue stripe and green stripe are intact. The purple stripe lost its red so it is now blue. All these are clues that the red was removed, as it says in the code. b) d) e) None/other/error

Which code segment takes the image on the left and transforms it to the image on the right? >> im = imread('rainbow.jpg'); >> z = zeros(size(im(:,:,1))); >> cat(3,z,im(:,:,2),z); >> imshow(ans) >> cat(3,z,z,im(:,:,3)); >> im = imread('rainbow.jpg'); >> z = zeros(size(im(:,:,1))); >> cat(3,im(:,:,1),z,z); >> imshow(ans) b) B Use as an opportunity to introduce functions zeros and cat (used them on homework). This preserves the green layer (2nd layer) and zeros out the 1st and 3rd. Correct This preserves the red layer and zeros out the 2nd and 3rd. d) None/other/error RGB color reference