1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| % Création du bouton pour ouvrir le fichier texte
uicontrol('style','pushbutton',...
'units','normalized',...
'position',[0.15 0.9 0.02 0.03],...
'string','...',...
'callback','Ouvrir');
% Création de la zone de texte où s'affichera le fichier chargé
uicontrol('style','edit',...
'units','normalized',...
'position',[0.05 0.9 0.1 0.05],...
'callback',@Fichier);
function Ouvrir
[filename,patchname]=uigetfile('*.txt','x');
fichier=fullfile(patchname, filename);
tableau=dlmread(fichier);
x=tableau(:,2);
y=tableau(:,3);
plot(x,y,'b*'); |
Partager