Code covered by the BSD License  

Highlights from
Sim.I.am

image thumbnail
from Sim.I.am by Jean-Pierre de la Croix
A MATLAB-based educational bridge between theory and practice in robotics.

GetArg(S, Name, Default)
function Value = GetArg(S, Name, Default)

try
    Value = S.(Name);
catch
    error('GetArg: unknown parameter ''%s''.',Name);
end

if isempty(Value)
    if nargin < 3
        error('Parameter ''%s'' must be assigned a value.',Name);
    end
    Value = Default;
end

Contact us