Help CenterHelp Center
fi
for loop to repeat specified number of times
for
for index = values statements end
index
values
statements
example
for index = values, statements, end executes a group of statements in a loop for a specified number of times.
for index = values, statements, end
If a colon, : operation with fi objects is used as the index, then the fi objects must be whole numbers.
colon, :
Refer to the MATLAB® for reference page for more information.
collapse all
Use a fi object as the index of a for loop.
a = fi(1,0,8,0); b = fi(2,0,8,0); c = fi(10,0,8,0); for x = a:b:c x end
x = 1 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 8 FractionLength: 0
x = 3 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 8 FractionLength: 0
x = 5 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 8 FractionLength: 0
x = 7 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 8 FractionLength: 0
x = 9 DataTypeMode: Fixed-point: binary point scaling Signedness: Unsigned WordLength: 8 FractionLength: 0
You have a modified version of this example. Do you want to open this example with your edits?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office