MatLab Manual / Looping Techniques in Matlab

Program Name

Write a Matlab Program for Looping Techniques.
Theory
Loop is a set of instructions used to perform a particular task. Matlab support while,for 
and nested loops.
Program Code


Input and Output:

Output:
For Loop
i value : 1
i value : 2
i value : 3
i value : 4

While Loop
j value : 1
j value : 2
j value : 3

Nested Loop
a value : 1 b value : 1
a value : 1 b value : 2
a value : 2 b value : 1
a value : 2 b value : 2
Click for Matlab Online Compiler (Copy, Paste and Press Enter)


Home     Back