How can I use defaults for some function inputs and only supply the arguments I want to change?

Sorry for my poor English.
I use “glpk” function and now I want to give the input argument vartype to be “III”, but if I want to give this argument I have to give at least"lb, ub and ctype". Could I use this glpk(c,a,b,vartype=“III”) like Python?

Sorry to disturb you.

The standard way to skip or omit positional arguments in Octave is to use [] as an empty argument placeholder. So try, for example

glpk (c, a, b, [], [], [], "III")

Octave does not currently provide a way to pass keyword arguments like Python, unless the function explicitly takes pairs of name-value arguments.

1 Like