I am using the topoplot function in Matlab as follows:
topoplot(DATA, channels, ...
'maplimits', topoYlim, 'electrodes', 'on', 'emarker', {'.','k',[6],1}, ...
'whitebk', 'on', 'style', 'both', 'shading', 'interp', 'drawaxis', 'off', ...
'numcontour', [0]);
The problem is that I have to use this function several times in different parts of the script. That really makes the script unnecessarily bulky and difficult to read.
Is there a way to save all the arguments in a variable (like a structure) so that I can just call something like:
topoplot(DATA, options)
P.S. I have tried something like:
options = splitvars(table(NaN(1,6)));
options.Var1_1 = 'maplimits'
options.Var1_2 = [-1 1]
options.Var1_3 = 'electrodes'
options.Var1_4 = 'on'
options.Var1_5 = 'emarker'
options.Var1_6 = {'.','k',[6],1}
but it doesn't work.
Thank you in advance
This is my suboptimal solution. I have created a separate function as follows:
function makeTopoplot(dataToPlot, channelsToUse, topoYlim)
topoplot(dataToPlot, channelsToUse, 'maplimits', topoYlim,
'electrodes', 'on', 'emarker', {'.','k',[6],1}, ...
'whitebk', 'on', 'style', 'both', 'shading', 'interp',
'drawaxis', 'off', 'numcontour', [0]);
end
Again, I would have preferred something without creating an external function, but didn't manage yet...