is there a way of typing for if like:
var = (cond) ? true : false;
or do we have to use this format?
if (cond)
true
else
Hmm... no one has mentioned this
fi = @(varargin)varargin{end-varargin{1}}
somewhere in the docs it is written the `end' is coming to one so this will be more future proof
fi = @(varargin)varargin{length(varargin)-varargin{1}}
Usage :
fi(input('Do you like Matlab ? '),'yes','no')
>> no
If your in the need of inline cases see Mathworks ...