Assuming we have a table T
in matlab and we want to iterate over its variable names. We can use the varnames
function to get the variable names and then iterate over them using a for loop. Here's an example:
main.m296 chars11 lines
This will print the variable names of the table T
:
main.m60 chars4 lines
We can then use the variable names to access the table variables within the for loop.
gistlibby LogSnag