I'm writing a MATLAB function that sets some variables for a Simulink simulation of a planar robot.
A bunch of values are to be set in the workspace, around 20. However, about half of them should be of no interest for the end user, because they are internal variables of the simulation (variables for Simulink switches, for handling errors in the simulation, etc.). Also, they have to be saved in the workspace with the name that's used in the Simulink model.
Because of this, I was thinking about storing these values not by return values of the function, but by using the assignin function. This way, they could be stored with the right names in the workspace and the end user could ignore them.
Do you think it would be appropriate or just confusing and smell of bad design?