by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - CODING/DEVELOP
Introduced first in SolidGeometry 4.3, Creation date: 2018-10-11, Last change: 2025-09-14
[nv,ea]=getfuncparams(n,args,v,[fillinm,b,b,b])
n: | number of parameter varargin | |
args: | varargin | |
v: | default value | |
fillinm: | default is false; if true, variable is filled with default values | |
b: | ||
b: | ||
b: |
nv: | value for variable or logical of found if there are two output arguments | |
ea: | true if argument was empty |
m=getfuncparams(1,varargin,1);
getfuncparams(1,{'a','b','c'},3)
getfuncparams(4,{'a','b','c'},3)
[a,b]=getfuncparams(2,{'a','','c'},3) % b shows that there 2nd is empty
[a,b]=getfuncparams(6,{'a','','c'},3) % b shows that 6th is empty
[a,b]=getfuncparams(3,{'a','','c'},'c') % b shows that 3rd is forced / given
getfuncparams(1,{9},[1 2 3 4]) % replaces the array by a scalar
getfuncparams(1,{9},[1 2 3 4],true) % replaces the first element of the array
getfuncparams(1,{[9 8 7]},[1 2 3 4],true) % replaces the first three elements of the array
A=SGbox, B=SGbox, C=[A B], getfuncparams(1,{A,B,C},[C B A],true)