Switch case statement in Octave GNU Last Updated : 01 Aug, 2020 Comments Improve Suggest changes Like Article Like Report Octave is open-source, free available for many of the platforms. It is a high-level language. It comes up with a text interface along with an experimental graphical interface. It is also used for various Machine Learning algorithms for solving various numeric problems. You can say that it is similar to MATLAB but slower than MATLAB. Switch case statements are a substitute for long if statements that compare a variable to several integral values. Switch case in Octave is a multiway branch statement. It allows a variable to be tested for equality against a list of values. Switch statement follows the approach of mapping and searching over a list of values. If there is more than one match for a specific value, then the switch statement will return the first match found of the value matched with the expression. Flowchart : Syntax : switch (expression) case label command_list case label command_list ... otherwise command_list endswitch Examples: MATLAB % value of choice choice = 3; switch choice case 1 printf("Choice is 1\n"); case 2 printf("Choice is 2\n"); case 3 printf("Choice is 3\n"); otherwise printf("Choice is other than 1, 2, 3\n"); endswitch Output : Choice is 3 Comment More infoAdvertise with us Next Article Switch case statement in Octave GNU I iamjpsonkar Follow Improve Article Tags : Programming Language Octave-GNU Similar Reads Vectors in Octave GNU Vector in Octave is similar to the array in every aspect except the vector size is dynamic, which means its size can be increased however array does not allow such type of increment in its size. Types of Vectors Row VectorColumn Vector Row vectors are created by enclosing the set of elements in squa 2 min read Loops (For and While) and Control Statements in Octave Control statements are expressions used to control the execution and flow of the program based on the conditions provided in the statements. These structures are used to make a decision after assessing the variable. In this article, weâll discuss control statements like the if statement, for and whi 5 min read How to take input in Octave GNU? Octave is open-source, free available for many of the platforms. It is a high-level language. It comes up with a text interface along with an experimental graphical interface. It is also used for various Machine Learning algorithms for solving various numeric problems. You can say that it is similar 3 min read How to output in Octave GNU Octave is open-source, free available for many of the platforms. It is a high-level language. It comes up with a text interface along with an experimental graphical interface. It is also used for various Machine Learning algorithms for solving various numeric problems. You can say that it is similar 3 min read Solidity - Decision Making Statements Decision making in programming is used when we have to adopt one out of a given set of paths for program flow. For this purpose, conditional statements are used which allows the program to execute the piece of code when the condition fulfills. Solidity uses control statements to control the flow of 4 min read Like