This is no longer maintained and has been superseded by datajoint-company/datajoint-docs. Please file new issues there (or help contribute!). We are currently migrating and generating new content until December 2022 after which we’ll be decomissioning https://docs.datajoint.org and https://tutorials.datajoint.org in favor of https://datajoint.com/docs/.
The DataJoint model primarily handles data as sets, in the form of tables. However, it can sometimes be useful to access or to perform actions such as visualization upon individual entities sequentially. In DataJoint this is accomplished through iteration.
In the simple example below, iteration is used to display the names and values of the primary key attributes of each entity in the simple table or table expression
for key = tab.fetch()' disp(key) end
Note that the results returned by
fetch must be transposed.
MATLAB iterates across columns, so the single column
struct returned by
fetch must be transposed into a single row.