Slightly depending on what you mean: yes.
The random number generation has a global state, so it doesn't matter if the call is nested in a function or not.
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!