MATLAB: Load() into workspace

load function script

If I place load() into a m-file script, it will load into the workspace, available for the caller.
If I place it into a m-file function, I will have to pass the variable names or nest out the struct.
Is there any way to pass load() into a function and pass whatever is in it directly into the workspace, without doing a lott of messy code?

Best Answer

Why don't you use textread or textscan or fscanf?
doc textread
doc textscan
doc fscanf
You can control the type of variables and furthermore you can even read the data with different delimiters.