Javatpoint Logo
Javatpoint Logo

MATLAB if-else... end statement

If the first condition is not true, then we can define other statements to run by using the else keyword.

Syntax:

Flow Diagram of if...else...end Statement

MATLAB if-else... end statement

Example1:

Output:

a = 15
an odd number

Example2:

Using if-else statement to determine the largest of two number

Output:

Enter number 1: 15
Enter number 2:20
num1 is less than num2






Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA