On 4/8/20 7:35 AM, Ian McCallion wrote:
> What is the right syntax for providing a function which does nothing
> except call another function with the same parameters and returns the
> same values back.
>
> The function below passes the parameters through, but getting returned
> values back does not work. I've tried various incantations without success
>
> function [varargout] = short(varargin)
> varargout = verylongame(varargin){:})
> endfunction
Try
function varargout = short (varargin)
varargout = cell (nargout, 1);
[varargout{:}] = verylongname (varargin{:});
endfunction
Then verylongname will see the same value for nargout that short does
when it is called. There are some forwarding functions like this in
Octave. For example, bar.m and barh.m both forward to an internal
function private/__bar__.m.
Magic, thank you!! I KNEW there should have been an appropriate syntax, but it had not occurred to me to initialise varargout to an appropriate sized cell array first.
Cheers... Ian