Changeset 3580


Ignore:
Timestamp:
04/20/10 15:56:47 (15 years ago)
Author:
jschierm
Message:

Utilities: update string_dim for special case of vectors.

File:
1 edited

Legend:

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

    r3572 r3580  
    1111end
    1212
     13%  check for scalar
     14
    1315if (numel(a) == 1) && (idim == 1)
    1416    sdim='';
    1517    return
    1618end
     19
     20%  check for overflow
     21
    1722if (idim > numel(a))
    1823    if ~isempty(inputname(1))
     
    2429    end
    2530end
     31
     32%  check for column or row vector (Matlab uses a minimum of two
     33%  dimensions, so this won't match Matlab standard output)
     34
     35if (ndims(a) == 2) && ((size(a,1) == 1) || (size(a,2) == 1))
     36    sdim =['(' num2str(idim) ')'];
     37    return
     38end
     39
     40%  do the general case
    2641
    2742asize=size(a);
Note: See TracChangeset for help on using the changeset viewer.