Related Structure Functions:
There are many functions which can be used with structures in a MATLAB. The function isstruct will return 1 for logical true when the variable argument is a structure variable, or 0 when not. The isfield function returns the logical true when a fieldname is a field in the structure argument or a logical false when not.
>> isstruct(package)
ans =
1
>> isfield(package,'cost')
ans =
1