FOR

From Jacket Wiki

Jump to: navigation, search
Back to Function List

Execute statements specified number of times

Usage

Jacket for M Language
    Supported Syntax
    
for index = values
   program statements
          :
end
    

GFOR Supported

Yes

GCOMPILE Supported

Yes

Types Supported

-  GDOUBLE   GSINGLE   GLOGICAL   GINT32   GINT8   GUINT32   GUINT8   COMPLEX 

Types Not Supported

-

CPU usageJacket only contains GPU computing functions. To run functions on the CPU, try one of the MathWorks products:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/for.html

Notes

A GFOR loop may be embedded as the innermost loop in a nested FOR loop.

When used with GCOMPILE (or ARRAYFUN), FOR loops may only use constants in the loop, and may only increment by a value >= 1, for example:

for i=0:10,      % GOOD
  ...
end
 
for i=0:2:10,    % GOOD
  ...
end

or

for i=0:0.5:10,  % BAD
  ...
end

See Also

GFOR, BREAK, COLON, CONTINUE, END, IF, RETURN, SWITCH, WHILE

Views
Personal tools