Pour les lecteurs de ce blog (s’il y en a!!!) ou les utilisateurs du forum MATLAB sur DVP ,vous avez surement remarqué que
je mets souvent des liens URL qui renvoient sur la doc Web de MATLAB.
Archives du mot-clé r2010b
Colorbar en standalone R2011a toujours buggué
Tout est dans le titre
Rappelez vous mon étude le 15 Octobre 2010 sur les options du menu contextuel offertes par la colorbar: Colorbar in deployed mode
J’ai refait le test avec MATLAB 7.12 (R2011a) et le MATLAB Compiler 4.15 (R2011a) …
Où est passée la membrane?!!
Code Performance
En R2010b il existait un chapitre « MATLAB Program Performance » (Improve performance and find potential problems in MATLAB code) dans lequel on trouvait 4 fonctions:
- mlint
- profile
- profsave
- rehash
La fonction bench a été depuis rajoutée sur le site web si on regarde attentivement la page concernant la R2010b
Bref à la Release suivante , la R2011a donc , ce chapitre fut renommé en « Code Performance » . la fonction rehash fut naturellement enlevée pour se retrouver logiquement dans le chapitre Variables and Functions in Memory … y aurait de quoi écrire un bouquin , non?!
Crash dump en ouvrant un GUI
Importdata en R2012a a changé!
whatsold
Je n’ai posté que 2 fichiers sur le File Exchange (FEX) de The MathWorks : whatsold.m que j’ai appelé « MATLAB Upgrade Utility » et emailtool_nodisplay.m que j’ai appelé « Send email using CDO ».
Le premier permet de savoir à chaque nouvelle Release de MATLAB les fonctions qui sont ou qui vont être supprimées , obsolètes , non documentées … d’où le nom de whatsold qui fait l’inverse de la fonction whatsnew shippée avec MATLAB.
Le second « Send email using CDO » permet d’envoyer des mails depuis MATLAB en utilisant votre messagerie Microsoft Outlook . Avec l’avantage que le nom de celui qui envoie le mail peut être modifié. J’en parlerai plus longuement dans un autre post.
Donc si on lance whatsold en R2010b , on aura ces informations suivantes dans un log :
***************************
1 functions « no longer supported » :
pixval: produces an error and is no longer supported. Use IMPIXELINFO
***************************
1 functions « has been removed » :
mex: This option has been removed.
***************************
7 functions « deprecated » :
mexdebug: MEXDEBUG has been deprecated, use DBMEX instead.
movefile: NOTE 5: ‘writable’ is being deprecated, but still supported for backwards
path2rc: PATH2RC is deprecated and has been renamed to SAVEPATH. PATH2RC still
helpwin: of multi-page help text. Note: this calling sequence is deprecated and
rand: syntax is still supported for backwards compatibility, but is deprecated.
randn: still supported for backwards compatibility, but is deprecated. Beginning
actxserver: The following syntaxes are deprecated and will not become obsolete. They
***************************
14 functions « is obsolete » :
sshow: (This function is obsolete. Use MAKESHOW and PLAYSHOW instead.)
isglobal: ISGLOBAL is obsolete and will be discontinued in a future
uigetfile: NOTE: THIS SYNTAX IS OBSOLETE AND WILL BE IGNORED
uigetfile: NOTE: THIS SYNTAX IS OBSOLETE AND WILL BE IGNORED.uiputfile: NOTE: THIS SYNTAX IS OBSOLETE AND WILL BE IGNORED.
uiputfile: NOTE: THIS SYNTAX IS OBSOLETE AND WILL BE IGNORED.wizard: WIZARD is obsolete and may be removed from future versions.
imfeature: Note: This function is obsolete and may be removed in
imview: Note: This function is obsolete and may be removed in
cremez: CREMEZ is obsolete. CREMEZ still works but may be removed in the future.
freqzplot: FREQZPLOT is obsolete. FREQZPLOT still works but may be
remez: REMEZ is obsolete. REMEZ still works but may be removed in the future.
remezord: REMEZORD is obsolete. REMEZORD still works but may be removed in the
specplot: SPECPLOT is obsolete. SPECPLOT still works but may be removed in the
spectrum: NOTE: The function form of SPECTRUM is obsolete. It still works but may
***************************
28 functions « will be removed in a future release » :
mmreader: MMREADER will be removed in a future release. Use VideoReader instead.
avifinfo: AVIFINFO will be removed in a future release. Use MMREADER
aviinfo: AVIINFO will be removed in a future release. Use MMREADER
aviread: AVIREAD will be removed in a future release. Use MMREADER
wavplay: WAVPLAY will be removed in a future release. Use AUDIOPLAYER instead.
wavrecord: WAVRECORD will be removed in a future release. Use AUDIORECORDER
codetoolsswitchyard: This function will be removed in a future release.
maxNumCompThreads: maxNumCompThreads will be removed in a future release. Please remove
exifread: will be removed in a future release. Please use IMFINFO instead.
str2rng: STR2RNG will be removed in a future release.
wk1const: WK1CONST will be removed in a future release.
wk1finfo: WK1FINFO will be removed in a future release.
wk1read: WK1READ will be removed in a future release.
wk1wrec: WK1WREC will be removed in a future release.
wk1write: WK1WRITE will be removed in a future release.
intwarning: INTWARNING will be removed in a future release.
delaunay3: DELAUNAY3 will be removed in a future release. Use DelaunayTri instead.
dsearch: DSEARCH will be removed in a future release.
griddata: these options will be removed in a future release.
griddata3: GRIDDATA3 will be removed in a future release. Use TriScatteredInterp instead.
tsearch: TSEARCH will be removed in a future release.
bessel: will be removed in a future release. Use BESSELJ instead.
findstr: FINDSTR will be removed in a future release. Use STRFIND instead.
isstr: ISSTR will be removed in a future release. Use ISCHAR instead.
setstr: SETSTR will be removed in a future release. Use CHAR instead.
str2mat: STR2MAT will be removed in a future release. Use CHAR instead.
strmatch: STRMATCH will be removed in a future release. Use STRNCMP instead.
strvcat: STRVCAT will be removed in a future release. Use CHAR instead.
***************************
60 functions « undocumented » :
functionhintsfunc: This undocumented function may be removed in a future release.
makemcode: This undocumented function may change in a future release.
capturescreen: undocumented helper function which may be removed in a future release of MATLAB
hgfeval: This undocumented helper function is for internal use.
isdfgate: This is an undocumented function and may be removed in a future release.
doclink: This function is undocumented and reserved for internal use. It may be
online_concatenator: This function is undocumented and reserved for internal use. It may be
parfor_M_check: This function is undocumented and reserved for internal use. It may be
parfor_endpoint_check: This function is undocumented and reserved for internal use. It may be
parfor_range_check: This function is undocumented and reserved for internal use. It may be
parfor_sliced_fcnhdl_check: This function is undocumented and reserved for internal use. It may be
adddatadlg: This undocumented function may be removed in a future release.
addsubplot: This undocumented function may be removed in a future release.
enableplottoolbuttons: This undocumented function may be removed in a future release.
getfigurefordesktopclient: This undocumented function may be removed in a future release.
getplottool: This undocumented function may be removed in a future release.
javaAddLsnrsToFigure: This undocumented function may be removed in a future release.
javaGetHandles: This undocumented function may be removed in a future release.
makedisplaynames: This undocumented function may be removed in a future release.
plottoolfunc: This undocumented function may be removed in a future release.
setupplotbrowser: This undocumented function may be removed in a future release.
usev6plotapi: This undocumented function may be removed in a future release
activateuimode: This function is undocumented and will change in a future release
adduimode: This function is undocumented and will change in a future release
awtcreate: This function is undocumented and will change in a future release
awtinvoke: This function is undocumented and will change in a future release
fignamer: This function is undocumented and will change in a future release
getptr: This function is undocumented and will change in a future release
getuimode: This function is undocumented and will change in a future release
hasuimode: This function is undocumented and will change in a future release
isactiveuimode: This function is undocumented and will change in a future release
javacomponent: This function is undocumented and will change in a future release
makemenu: This function is undocumented and will change in a future release
overobj: This function is undocumented and will change in a future release
remapfig: This function is undocumented and will change in a future release
setptr: This function is undocumented and will change in a future release
tabdlg: This function is undocumented and will change in a future release
tipoftheday: This function is undocumented and will change in a future release
uiclearmode: This function is undocumented and will change in a future release
uicontainer: This function is undocumented and will change in a future release
uiflowcontainer: This function is undocumented and will change in a future release
uigetmodemanager: This function is undocumented and will change in a future release
uigettool: This function is undocumented and will change in a future release
uigridcontainer: This function is undocumented and will change in a future release
uiload: This function is undocumented and will change in a future release
uimode: This function is undocumented and will change in a future release
uirestore: This function is undocumented and will change in a future release
uisuspend: This function is undocumented and will change in a future release
uitab: This function is undocumented and will change in a future release
uitabgroup: This function is undocumented and will change in a future release
uitoolfactory: This function is undocumented and will change in a future release
uitree: This function is undocumented and will change in a future release
uitreenode: This function is undocumented and will change in a future release
uiundo: This function is undocumented and will change in a future release
iptgate: This is an undocumented function and may be removed in a future release.
imuitoolsgate: This is an undocumented function and may be removed in a future release.
utctrlCheckLogNames: This function is undocumented and will change in a future release.
imageplotfunc: This is an undocumented function and may be removed in a future release.
completefreqresp: This is an undocumented function.
psdfreqvec: This undocumented function may be removed in a future release.
***************************
4 functions « Internal use only » :
indentmcode: This file is for internal use only and is subject to change without
mdbfileonpath: This file is for internal use only and is subject to change without
is2D: Internal use only. This function may be removed in a future release.
resetplotview: Internal use only. This function may be removed in a future release.
Si je relance whatsold dans la Prerelease R2011a je vais avoir un nouveau log.
Ce que j’ai fait ensuite c’est de comparer en utilisant la fonction visdiff le résultat des logs R2010b et R2011a.
On apprend ainsi :
- Message qui apparaissait en 10 b et qu’on ne trouve plus en 11a
intwarning: INTWARNING will be removed in a future release.
- Nouveaux messages en R2011a:
Les fonctions qui n’existent plus en R2011a :
ipttable: IPTTABLE has been removed. Use UITABLE instead.
cholinc: CHOLINC will be removed in a future release. Use ICHOL instead.
cholinc: CHOLINC(X,’inf’) will be removed in a future release.
luinc: LUINC will be removed in a future release. Use ILU instead.
Les nouvelles fonctions en R2011a non-documentées:
primitivevertexpicker: This function is undocumented and may change in a future release.
contours: This undocumented function may be removed in a future release.
makebars: This undocumented function may be removed in a future release.
figureDefaultMenubar: This function is undocumented and will change in a future release.
figureDefaultToolbar: This function is undocumented and will change in a future release.
Hum hum intéressant tout ça …
Les 2 dernières fonctions non docuementées font ce que leur nom indiquent:
figureDefaultMenubar : Create default toolbar.
figureDefaultToolbar : Create default menus.
Quant aux autres voilà ce qu’on lit dans le Header du M-file:
MAKEBARS : Make data for bar charts.
CONTOURS : Contouring over non-rectangular surface.
PRIMITIVEVERTEXPICKER un peu compliqué à mon gout pour en parler!
Comparer des dossiers avec un filtre
- Citons les Releases Notes R2011a
Dans les releases notes de la R2011a , au chapitre Desktop Tools and Development Environment, MATLAB Version 7.12 (R2011a) on peut lire :
Filter Results in Folder Comparisons
You can now define filters to exclude unimportant differences when comparing folders. For example, you can exclude backup files or files created by a revision control system. Filters can save time when reviewing differences, especially when comparing many subfolders.
- Exemple
Concrètement imaginons que je veuille comparer les répertoires \matlabroot\extern\examples\mex de la R2010b et de la R2011a:
sur ma machine en ligne de commande cela revient à taper:
>> visdiff(‘C:\Program Files\MATLAB\R2011a\extern\examples\mex’,’C:\Program Files\MATLAB\R2010b\extern\examples\mex’)
Pour info , ces répertoires donnent des exemples pour apprendre à écrire des MEX-files en C ou en Fortran.
et voilà ce que j’obtiens dans le Comparison Tool :
Seul un fichier est différent c’est le fichier binaire explore.mexw32 qui est un MEX file compilé à partir de l’exemple explore.c.
Évidemment comparer des fichiers binaires n’a pas de sens. Donc à partir de la R2011a il est possible de filtrer les résultats dans l’outil de comparaison.
- Petite parenthèse sur explore.c
Ra je ne peux pas m’empêcher de vous parler de ce fichier qui est fort utile, non seulement pour écrire des Mex-files mais aussi pour comme son nom l’indique explorer ses variables MATLAB : structure , cellule , valeurs numériques, chaines de caractères … Par exemple imaginons que je crée la structure suivante :
>> aurelien.age=31
aurelien =
age: 31
>> aurelien.passion=’matlab’
aurelien =
age: 31
passion: ‘matlab’
Si je lance explore dans MATLAB , ce qui va marcher car il a été mexé sous Windows comme on dit dans le milieu geek , j’obtiens :
>> explore(aurelien)
————————————————
Name: prhs[0]
Dimensions: 1×1
Class Name: struct
————————————————(1,1).age
————————————————
Dimensions: 1×1
Class Name: double
————————————————
(1,1) = 31(1,1).passion
————————————————
Dimensions: 1×6
Class Name: char
————————————————
(1,1) matlab
C’est pas génial ça?!!!
- Et maintenant utilisons le filtre!
En cliquant sur le bouton:
apparait cette petite interface qui me permet de rajouter un filtre:
je vais pouvoir ajouter mon filtre *.mexw32 en cliquant sur le bouton + :
ce qui me rajoute un troisième élément à ma liste d’extension à exclure:
En cliquant sur OK, les changements prennent effet immédiatement. Et on voit que le mex file est à présent ignoré dans la comparaison:
Voilà moi je trouve ça super comme nouvelle fonctionnalité , encore une bonne raison d’upgrader en R2011a!
Acceder au nom d’un fichier
Jeudi 27 janvier , j’ai demandé sur le MATLAB newsgroup comment on pouvait retrouver le nom d’un fichier en connaissant juste son fid (file identifier)
Je m’explique. Imaginons vous ouvrez un fichier en écriture:
fid =fopen(fullfile(matlabroot,’matlabgeek.txt’),’w+’)
Comment faire en connaissant juste la variable fid pour retrouver le nom du fichier , c’est à dire matlabgeek.txt.
Au début on m’a proposé la solution suivante:
>> filename =System.IO.DirectoryInfo(fopen(fid)).FullName
filename =
C:\MATLAB\SOF\r2010b\matlabgeek.txt
Paie ta commande de Geek!!
Seul hic, c’est que ça en marchera que sur Windows . Donc cette solution ne m’intéressait pas.
Et en plus apparemment il faut avoir .NET installé ….
Finalement c’est Loren Shure qui m’a proposé une solution toute simple et cross-platefrome, c’est de refaire un fopen sur le fid ! :
>>filename =fopen(fid)
filename =
C:\MATLAB\SOF\r2010b\matlabgeek.txt
Voilà , je voulais partager ça avec vous, aucun de mes collègues ne connaissait ce trick.
A noter que nul part dans la doc de fopen on trouve cette astuce.
Ce MATLAB trick avec fopen fonctionne dans toutes les releases MATLAB … même en R12SP1 !