In this tutorial, we will learn about Octave while statement. The while statement is a loop statement in Octave.
Octave’s while statement syntax is as follows:
The while statement executes the loop statements as long as the while condition is true. The condition expression in the while statement is considered true if its value is non-zero, and false if its value is zero.
The while is an indefinite loop. We can use this loop when we don’t know beforehand the number of iterations for the loop. The loop executes until the loop condition is true.
% Sample Octave Script
% while Loop Demo
% Octave Tutorials – www.TestingDocs.com
% Initialize loop variable
loopVar = 1;
% While Loop to print 1 – 10
while( loopVar <= 10)
Octave Tutorial on this website can be found at:
More information on Octave can be found on the official website: