Here's a recursive function in MATLAB that takes an array as input and prints its contents:
main.m219 chars11 lines
To use this function, simply call printArray(arr)
where arr
is your array. The function will recursively print out each element of the array separated by a space.
Note: Depending on the size of the array, using recursion to print out all its contents may not be the most efficient solution. Consider using a loop instead for larger arrays.
gistlibby LogSnag