MATLAB COMPILER RELEASE NOTES Guide de l'utilisateur Page 398

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 716
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 397
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.
Vue de la page 397
1 2 ... 393 394 395 396 397 398 399 400 401 402 403 ... 715 716

Commentaires sur ces manuels

Pas de commentaire