I want to convert a recursive function to a iterative one. What I normally do is, I initialize a queue, put the first job into queue. Then in a while loop I consume
If you insist on using proper data structures, you can use Java from inside MATLAB:
import java.util.LinkedList q = LinkedList(); q.add('item1'); q.add(2); q.add([3 3 3]); item = q.remove(); q.add('item4');