In your case the try instruction does not produce an error (at least if
the MESURE-FB.TMP file exists). So the catch instruction are not called
I think the following code should do the job:
NumPiece=X0(1,1);
data=fscanfMat('MESURE-FB.TMP');
choix=data(data(:,1)==NumPiece,:);
if choix==[] then
choix=[NumPiece,-1000,-1000];
end
Serge Steer