SlideServe
Menu
Préférences
© SlideServe · v2026

Introduction to Programming in MATLAB

temima avatar
5 diapositives · 225 Views · Jul 31, 2014

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 . Choosing the most appropriate.

Introduction to Programming in MATLAB - slide 1
01 / 5Introduction to Programming in MATLAB
1 / 17

Télécharger la présentation

Introduction to Programming in MATLAB
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. 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.

  2. Choosing the most appropriate Control Flow

  3. Control Flow • I want to write a function that iterates over the pixels of a matrix to see if there is one that is pure green (0 255 0). If there is, I will return true, otherwise I will return false.Which type of control flow should I use? • if/elseif/else • switch/case • for loop • while loop • Other/none/more than one

  4. Control Flow • I want to write a function that reads input that the user types, while the user types it (we haven’t learned this yet, but it is very easy to do—just a call to a function similar to display, but it reads in addition to writing). We call the read function once for each line of text read, and we want to keep calling the read function repeatedly until we detect that the user typed ‘STOP’.Which type of control flow should I use? • if/elseif/else • switch/case • for loop • while loop • Other/none/more than one

  5. Control Flow • My BakeTime function takes as input one of five different values (‘pizza’, ‘casserole’, ‘bread’, ‘chicken’, ‘cupcakes’). Depending on which it is, we will return a different number of minutes that item should be baked in an oven. Which type of control flow should I use? • if/elseif/else • switch/case • for loop • while loop • Other/none/more than one