SlideShare una empresa de Scribd logo
1 de 14
electricalenggtutorial.blogspot.com
1
INTRODUCTION
In this lecture we will discuss more
about Loop control.
- Switch – case commands
- Nested lops
- break command
- continue command
2
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
SWITCH - CASE
• There is no conditional statement.
• It choose code to execute based on
value of scalar or string, not just
true/false
• Different codes can be executed
based on the value of the scalar.
• It is easier than if-elseif-end
commands if the conditions are more.
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
3
SWITCH-CASE SYNTAX
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
4
SWITCH-CASE SYNTAX…
• The expression after switch command is
evaluated first.
• If the obtained value is equal to
value1 – then commands below case value1
is executed up to
next case or otherwise or
or end statement.
• Similarly if the obtained value is equal
to value2 – then then commands below case
value2 is executed.
• If switch-expression not equal to any of
the values in case statement, commands
after otherwise executed.
• If otherwise command is not present, no
commands are executed
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
5
SWITCH-CASE EXAMPLE
id = input(‘enter your id’)
switch id
case ‘321456'
display (‘You name is Martin’)
case ‘320423'
display (‘You name is Allen’)
case ‘332458'
display (‘You name is Mohan’)
case ‘321564'
display (‘You name is Vicky’)
otherwise
display (‘You are not a member of the
class’)
end
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
6
NESTED LOOP
• A loop or conditional statement is
placed inside another loop or
conditional statement.
• Simply, a loop within a loop
• Both for and while loops can be
nested.
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
7
NESTED LOOP SYNTAX
for ii = 1:n
for jj = 1:m
<Commands>
end
end
while expression1
while expression2
< Commands >
end
end
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
8
NESTED LOOP EXAMPLE
Program to display a 2D matrix
M = [1 2 3; 4 5 6; 7 8 9];
[r c] = size(M);
for Row = 1:r
for Col = 1:c
fprintf('Element(%d,%d)= %d.n',
Row, Col, M(Row, Col))
end
end
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
9
NESTED LOOP EXAMPLE…
I=1; N=10;
while I<=N
J=1;
while J<=N
A(I,J)=1/(I+J-1);
J=J+1;
end
I=I+1;
end
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
10
BREAK COMMAND
• When inside a loop (for and
while), break terminates
execution of loop
• MATLAB jumps from break to end
command of loop, then continues
with next command (does not go
back to the for or while command
of that loop).
• ‘break’ ends whole loop, not just
last pass
• If break inside nested loop, only
nested loop terminated (not any
outer loops)
• break command in script or
function file but not in a loop
terminates execution of file
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
11
BREAK EXAMPLE
Program to display prime numbers from 1 to
50. The program exit from the inner loop
using break, if the number is not a prime.
for n=2:50
for m=2:50
if(~mod(n,m))
break
end
end
if(m > (n/m))
fprintf('%d is primen', n); end
end
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
12
CONTINUE COMMAND
• Used to stop current iteration
and start next iteration in a
loop
• Can be used with both for- and
while loops
• ‘continue’ is used usually as
part of a conditional
statement.
• When the program execution
reaches ‘continue’ it stop
executing the remaining
commands in loop and jump to
the end command of loop and
then starts a new iteration
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
13
CONTINUE EXAMPLE
a = 1;
while a < 20
if a == 15
a = a + 1;
continue; % skip the iteration for a=15
end
fprintf('value of a: %dn', a);
a = a + 1;
end
e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
14

Más contenido relacionado

La actualidad más candente

MATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output CommandsMATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output CommandsShameer Ahmed Koya
 
Du1 complex numbers and sequences
Du1 complex numbers and sequencesDu1 complex numbers and sequences
Du1 complex numbers and sequencesjmancisidor
 
Capitulo 5, 7ma edición
Capitulo 5, 7ma ediciónCapitulo 5, 7ma edición
Capitulo 5, 7ma ediciónSohar Carr
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to MatlabAmr Rashed
 
Introduction to Matlab for Engineering Students.pdf
Introduction to Matlab for Engineering Students.pdfIntroduction to Matlab for Engineering Students.pdf
Introduction to Matlab for Engineering Students.pdfDrAzizulHasan1
 
Presentation on application of numerical method in our life
Presentation on application of numerical method in our lifePresentation on application of numerical method in our life
Presentation on application of numerical method in our lifeManish Kumar Singh
 
Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiersIstiak Ahmed
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm sachin varun
 
Introduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationIntroduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationAmrinder Arora
 
Operator Precedence Grammar
Operator Precedence GrammarOperator Precedence Grammar
Operator Precedence GrammarHarisonFekadu
 
Teoría básica de los semigrupos y grupos
Teoría básica de los semigrupos y gruposTeoría básica de los semigrupos y grupos
Teoría básica de los semigrupos y gruposLuis Talledo Yahuana
 
Further pure mathmatics 3 vectors
Further pure mathmatics 3 vectorsFurther pure mathmatics 3 vectors
Further pure mathmatics 3 vectorsDennis Almeida
 
Partial-Orderings in Discrete Mathematics
 Partial-Orderings in Discrete Mathematics Partial-Orderings in Discrete Mathematics
Partial-Orderings in Discrete MathematicsMeghaj Mallick
 
Metodo de la secante en scilab
Metodo de la secante en scilabMetodo de la secante en scilab
Metodo de la secante en scilabTensor
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraRupali Rana
 

La actualidad más candente (20)

MATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output CommandsMATLAB programming tips 2 - Input and Output Commands
MATLAB programming tips 2 - Input and Output Commands
 
Du1 complex numbers and sequences
Du1 complex numbers and sequencesDu1 complex numbers and sequences
Du1 complex numbers and sequences
 
Capitulo 5, 7ma edición
Capitulo 5, 7ma ediciónCapitulo 5, 7ma edición
Capitulo 5, 7ma edición
 
Logaritmos
LogaritmosLogaritmos
Logaritmos
 
Introduction to Matlab
Introduction to MatlabIntroduction to Matlab
Introduction to Matlab
 
Introduction to Matlab for Engineering Students.pdf
Introduction to Matlab for Engineering Students.pdfIntroduction to Matlab for Engineering Students.pdf
Introduction to Matlab for Engineering Students.pdf
 
Presentation on application of numerical method in our life
Presentation on application of numerical method in our lifePresentation on application of numerical method in our life
Presentation on application of numerical method in our life
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 
Predicates and quantifiers
Predicates and quantifiersPredicates and quantifiers
Predicates and quantifiers
 
minimum spanning trees Algorithm
minimum spanning trees Algorithm minimum spanning trees Algorithm
minimum spanning trees Algorithm
 
Introduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic NotationIntroduction to Algorithms and Asymptotic Notation
Introduction to Algorithms and Asymptotic Notation
 
Operator Precedence Grammar
Operator Precedence GrammarOperator Precedence Grammar
Operator Precedence Grammar
 
Graph theory Eulerian graph
Graph theory Eulerian graphGraph theory Eulerian graph
Graph theory Eulerian graph
 
Teoría básica de los semigrupos y grupos
Teoría básica de los semigrupos y gruposTeoría básica de los semigrupos y grupos
Teoría básica de los semigrupos y grupos
 
Further pure mathmatics 3 vectors
Further pure mathmatics 3 vectorsFurther pure mathmatics 3 vectors
Further pure mathmatics 3 vectors
 
Partial-Orderings in Discrete Mathematics
 Partial-Orderings in Discrete Mathematics Partial-Orderings in Discrete Mathematics
Partial-Orderings in Discrete Mathematics
 
Indices & logarithm
Indices & logarithmIndices & logarithm
Indices & logarithm
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Metodo de la secante en scilab
Metodo de la secante en scilabMetodo de la secante en scilab
Metodo de la secante en scilab
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
 

Destacado

User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1Shameer Ahmed Koya
 
User Defined Functions in MATLAB part 2
User Defined Functions in MATLAB part 2User Defined Functions in MATLAB part 2
User Defined Functions in MATLAB part 2Shameer Ahmed Koya
 
User Defined Functions in MATLAB Part-4
User Defined Functions in MATLAB Part-4User Defined Functions in MATLAB Part-4
User Defined Functions in MATLAB Part-4Shameer Ahmed Koya
 
Anonymous and Inline Functions in MATLAB
Anonymous and Inline Functions in MATLABAnonymous and Inline Functions in MATLAB
Anonymous and Inline Functions in MATLABShameer Ahmed Koya
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab ScriptsShameer Ahmed Koya
 
Matlab solving rlc circuit
Matlab solving rlc circuitMatlab solving rlc circuit
Matlab solving rlc circuitAmeen San
 
Matlab Programming Tips Part 1
Matlab Programming Tips Part 1Matlab Programming Tips Part 1
Matlab Programming Tips Part 1Shameer Ahmed Koya
 
Matlab Programming Assignment help , Matlab Programming Online tutors
Matlab Programming Assignment help , Matlab Programming Online tutorsMatlab Programming Assignment help , Matlab Programming Online tutors
Matlab Programming Assignment help , Matlab Programming Online tutorsjohn mayer
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkTUOS-Sam
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentationtigerwarn
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In RRsquared Academy
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlabTUOS-Sam
 
Mat lab workshop
Mat lab workshopMat lab workshop
Mat lab workshopVinay Kumar
 
Basics of programming in matlab
Basics of programming in matlabBasics of programming in matlab
Basics of programming in matlabAKANKSHA GUPTA
 
metode numerik stepest descent dengan rerata aritmatika
metode numerik stepest descent dengan rerata aritmatikametode numerik stepest descent dengan rerata aritmatika
metode numerik stepest descent dengan rerata aritmatikaSabarinsyah Piliang
 

Destacado (20)

Matlab Script - Loop Control
Matlab Script - Loop ControlMatlab Script - Loop Control
Matlab Script - Loop Control
 
User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1User defined Functions in MATLAB Part 1
User defined Functions in MATLAB Part 1
 
User Defined Functions in MATLAB part 2
User Defined Functions in MATLAB part 2User Defined Functions in MATLAB part 2
User Defined Functions in MATLAB part 2
 
User Defined Functions in MATLAB Part-4
User Defined Functions in MATLAB Part-4User Defined Functions in MATLAB Part-4
User Defined Functions in MATLAB Part-4
 
Anonymous and Inline Functions in MATLAB
Anonymous and Inline Functions in MATLABAnonymous and Inline Functions in MATLAB
Anonymous and Inline Functions in MATLAB
 
Introduction to Matlab Scripts
Introduction to Matlab ScriptsIntroduction to Matlab Scripts
Introduction to Matlab Scripts
 
Matlab time series example
Matlab time series exampleMatlab time series example
Matlab time series example
 
MATLAB Scripts - Examples
MATLAB Scripts - ExamplesMATLAB Scripts - Examples
MATLAB Scripts - Examples
 
Matlab solving rlc circuit
Matlab solving rlc circuitMatlab solving rlc circuit
Matlab solving rlc circuit
 
Matlab loops
Matlab loopsMatlab loops
Matlab loops
 
Matlab Programming Tips Part 1
Matlab Programming Tips Part 1Matlab Programming Tips Part 1
Matlab Programming Tips Part 1
 
Matlab Programming Assignment help , Matlab Programming Online tutors
Matlab Programming Assignment help , Matlab Programming Online tutorsMatlab Programming Assignment help , Matlab Programming Online tutors
Matlab Programming Assignment help , Matlab Programming Online tutors
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & Coursework
 
Abstract Class Presentation
Abstract Class PresentationAbstract Class Presentation
Abstract Class Presentation
 
R Programming: Numeric Functions In R
R Programming: Numeric Functions In RR Programming: Numeric Functions In R
R Programming: Numeric Functions In R
 
Variables in matlab
Variables in matlabVariables in matlab
Variables in matlab
 
Mat lab workshop
Mat lab workshopMat lab workshop
Mat lab workshop
 
Matlab lec1
Matlab lec1Matlab lec1
Matlab lec1
 
Basics of programming in matlab
Basics of programming in matlabBasics of programming in matlab
Basics of programming in matlab
 
metode numerik stepest descent dengan rerata aritmatika
metode numerik stepest descent dengan rerata aritmatikametode numerik stepest descent dengan rerata aritmatika
metode numerik stepest descent dengan rerata aritmatika
 

Similar a MATLAB Programming - Loop Control Part 2

Mesics lecture 7 iteration and repetitive executions
Mesics lecture 7   iteration and repetitive executionsMesics lecture 7   iteration and repetitive executions
Mesics lecture 7 iteration and repetitive executionseShikshak
 
Loop and while Loop
Loop and while LoopLoop and while Loop
Loop and while LoopJayBhavsar68
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements Tarun Sharma
 
1. Control Structure in C.pdf
1. Control Structure in C.pdf1. Control Structure in C.pdf
1. Control Structure in C.pdfRanjeetaSharma8
 
Unit II chapter 4 Loops in C
Unit II chapter 4 Loops in CUnit II chapter 4 Loops in C
Unit II chapter 4 Loops in CSowmya Jyothi
 
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested LoopLoops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested LoopPriyom Majumder
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in Csana shaikh
 
12 lec 12 loop
12 lec 12 loop 12 lec 12 loop
12 lec 12 loop kapil078
 
Control Structures.pptx
Control Structures.pptxControl Structures.pptx
Control Structures.pptxssuserfb3c3e
 
C Programming - Decision making, Looping
C  Programming - Decision making, LoopingC  Programming - Decision making, Looping
C Programming - Decision making, LoopingMURALIDHAR R
 
03 conditions loops
03   conditions loops03   conditions loops
03 conditions loopsManzoor ALam
 
Fundamental of Information Technology - UNIT 8
Fundamental of Information Technology - UNIT 8Fundamental of Information Technology - UNIT 8
Fundamental of Information Technology - UNIT 8Shipra Swati
 

Similar a MATLAB Programming - Loop Control Part 2 (20)

Mesics lecture 7 iteration and repetitive executions
Mesics lecture 7   iteration and repetitive executionsMesics lecture 7   iteration and repetitive executions
Mesics lecture 7 iteration and repetitive executions
 
Ch6 Loops
Ch6 LoopsCh6 Loops
Ch6 Loops
 
Loop and while Loop
Loop and while LoopLoop and while Loop
Loop and while Loop
 
Control Flow Statements
Control Flow Statements Control Flow Statements
Control Flow Statements
 
[ITP - Lecture 11] Loops in C/C++
[ITP - Lecture 11] Loops in C/C++[ITP - Lecture 11] Loops in C/C++
[ITP - Lecture 11] Loops in C/C++
 
1. Control Structure in C.pdf
1. Control Structure in C.pdf1. Control Structure in C.pdf
1. Control Structure in C.pdf
 
Loops c++
Loops c++Loops c++
Loops c++
 
Session 3
Session 3Session 3
Session 3
 
Loops in c
Loops in cLoops in c
Loops in c
 
Unit II chapter 4 Loops in C
Unit II chapter 4 Loops in CUnit II chapter 4 Loops in C
Unit II chapter 4 Loops in C
 
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested LoopLoops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
Loops in C Programming | for Loop | do-while Loop | while Loop | Nested Loop
 
Control Structures in C
Control Structures in CControl Structures in C
Control Structures in C
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
Loops in Python.pptx
Loops in Python.pptxLoops in Python.pptx
Loops in Python.pptx
 
12 lec 12 loop
12 lec 12 loop 12 lec 12 loop
12 lec 12 loop
 
Iteration
IterationIteration
Iteration
 
Control Structures.pptx
Control Structures.pptxControl Structures.pptx
Control Structures.pptx
 
C Programming - Decision making, Looping
C  Programming - Decision making, LoopingC  Programming - Decision making, Looping
C Programming - Decision making, Looping
 
03 conditions loops
03   conditions loops03   conditions loops
03 conditions loops
 
Fundamental of Information Technology - UNIT 8
Fundamental of Information Technology - UNIT 8Fundamental of Information Technology - UNIT 8
Fundamental of Information Technology - UNIT 8
 

Último

ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 

Último (20)

ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
Incoming and Outgoing Shipments in 3 STEPS Using Odoo 17
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 

MATLAB Programming - Loop Control Part 2

  • 2. INTRODUCTION In this lecture we will discuss more about Loop control. - Switch – case commands - Nested lops - break command - continue command 2 e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m
  • 3. SWITCH - CASE • There is no conditional statement. • It choose code to execute based on value of scalar or string, not just true/false • Different codes can be executed based on the value of the scalar. • It is easier than if-elseif-end commands if the conditions are more. e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 3
  • 4. SWITCH-CASE SYNTAX e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 4
  • 5. SWITCH-CASE SYNTAX… • The expression after switch command is evaluated first. • If the obtained value is equal to value1 – then commands below case value1 is executed up to next case or otherwise or or end statement. • Similarly if the obtained value is equal to value2 – then then commands below case value2 is executed. • If switch-expression not equal to any of the values in case statement, commands after otherwise executed. • If otherwise command is not present, no commands are executed e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 5
  • 6. SWITCH-CASE EXAMPLE id = input(‘enter your id’) switch id case ‘321456' display (‘You name is Martin’) case ‘320423' display (‘You name is Allen’) case ‘332458' display (‘You name is Mohan’) case ‘321564' display (‘You name is Vicky’) otherwise display (‘You are not a member of the class’) end e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 6
  • 7. NESTED LOOP • A loop or conditional statement is placed inside another loop or conditional statement. • Simply, a loop within a loop • Both for and while loops can be nested. e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 7
  • 8. NESTED LOOP SYNTAX for ii = 1:n for jj = 1:m <Commands> end end while expression1 while expression2 < Commands > end end e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 8
  • 9. NESTED LOOP EXAMPLE Program to display a 2D matrix M = [1 2 3; 4 5 6; 7 8 9]; [r c] = size(M); for Row = 1:r for Col = 1:c fprintf('Element(%d,%d)= %d.n', Row, Col, M(Row, Col)) end end e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 9
  • 10. NESTED LOOP EXAMPLE… I=1; N=10; while I<=N J=1; while J<=N A(I,J)=1/(I+J-1); J=J+1; end I=I+1; end e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 10
  • 11. BREAK COMMAND • When inside a loop (for and while), break terminates execution of loop • MATLAB jumps from break to end command of loop, then continues with next command (does not go back to the for or while command of that loop). • ‘break’ ends whole loop, not just last pass • If break inside nested loop, only nested loop terminated (not any outer loops) • break command in script or function file but not in a loop terminates execution of file e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 11
  • 12. BREAK EXAMPLE Program to display prime numbers from 1 to 50. The program exit from the inner loop using break, if the number is not a prime. for n=2:50 for m=2:50 if(~mod(n,m)) break end end if(m > (n/m)) fprintf('%d is primen', n); end end e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 12
  • 13. CONTINUE COMMAND • Used to stop current iteration and start next iteration in a loop • Can be used with both for- and while loops • ‘continue’ is used usually as part of a conditional statement. • When the program execution reaches ‘continue’ it stop executing the remaining commands in loop and jump to the end command of loop and then starts a new iteration e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 13
  • 14. CONTINUE EXAMPLE a = 1; while a < 20 if a == 15 a = a + 1; continue; % skip the iteration for a=15 end fprintf('value of a: %dn', a); a = a + 1; end e l e c t r i c a l e n g g t u t o r i a l . b l o g s p o t . c o m 14