User`s guide

R2009a
16-18
size and range Implemented for validateattributes
The validateattributes function now enables you to check the size and range of the input
value. The following commands validate the size and range of the values of x and y
respectively:
x = rand(4,2,6);
y = uint8(50:10:200);
validateattributes(x, {'numeric'}, {'size', [4,2,6]});
validateattributes(y, {'uint8'}, {'>=', 50, '<=', 200})
isempty Supported for Map Objects
MATLAB now supports the isempty function for containers.Map objects. This example
creates a 0-by-1 Map object and runs isempty on it:
mapObj = containers.Map;
size(mapObj)
ans =
0 1
isempty(mapObj)
ans =
1
Bug Fix for Misinterpreted Variables
The example below describes a bug in the MATLAB software that has been fixed in
version 7.8. The bug was caused by misinterpretation of an unassigned variable. For
certain names, MATLAB mistakenly interpreted the variable as a stem in dot indexing.
The following example illustrates the problem. The example is a bit artificial (which is
why the bug went undiscovered for so long).
Suppose you have a function that is intended to perform two levels of dot-indexing:
function y = dotindextwice_A(j)
y = j.lang.String;
Calling this function with no arguments results in an error in all versions of MATLAB,
as it should.