Changeset 3569


Ignore:
Timestamp:
04/19/10 14:26:25 (15 years ago)
Author:
jschierm
Message:

QMU with Dakota: addition of two new utilities and some error message changes.

Location:
issm/trunk/src/m/utils/Array
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/utils/Array/item2str.m

    r33 r3569  
    1717    svec=num2str(a);
    1818else
    19     warning('item2str:item_unrecog',...
    20         'Item ''%s'' is of unrecognized type ''%s''.',...
    21         inputname(1),class(a));
     19    if ~isempty(inputname(1))
     20        warning('item2str:item_unrecog',...
     21            'Item ''%s'' is of unrecognized type ''%s''.',...
     22            inputname(1),class(a));
     23    else
     24        warning('item2str:item_unrecog',...
     25            'Item %d is of unrecognized type ''%s''.',...
     26            1,class(a));
     27    end
    2228    return
    2329end
  • issm/trunk/src/m/utils/Array/string_dim.m

    r33 r3569  
    1616end
    1717if (idim > numel(a))
    18     error('Index %d exceeds number of elements in ''%s''.',...
    19         idim,inputname(1));
     18    if ~isempty(inputname(1))
     19        error('Index %d exceeds number of elements in array ''%s''.',...
     20            idim,inputname(1));
     21    else
     22        error('Index %d exceeds number of elements in array %d.',...
     23            idim,1);
     24    end
    2025end
    2126
  • issm/trunk/src/m/utils/Array/struc_desc.m

    r3093 r3569  
    77
    88if ~isfield(sarray,'descriptor')
    9     error(['Field ''descriptor'' not found in array ''' inputname(1) '''.']);
     9    if ~isempty(inputname(1))
     10        error('Field ''descriptor'' not found in array ''%s''.',inputname(1));
     11    else
     12        error('Field ''descriptor'' not found in array %d.',1);
     13    end
    1014end
    1115
Note: See TracChangeset for help on using the changeset viewer.