1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
| function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%[filename pathname] = uigetfile({'*.txt'},'Choisir un fichier');
%if isequal(filename,0) | isequal(pathname,0)
%disp('User pressed cancel')
%text=sprintf([num2str(i) 'Reessayer ! l\n']);
%set(handles.edit5, 'String', text)
%disp(['User selected ', fullfile(pathname, filename)])
%end
%fullpathname = strcat (pathname, filename);
%set(handles.edit5, 'String', fullpathname)
%[filename] = uigetfile({'*.txt'},'Choisir un fichier');
%fprintf('Tu as demandé : %s\n', filename);
%wh=which(filename);
%if exist(filename, 'file') == 2
% fprintf('Ouvrir dans Matlab: %s\n', filename);
% edit(filename);
% set(handles.edit5, 'String')
% eiseif ~isempty(wh)
% fprintf('Ouvrir dans Matlab : %s\n', wh);
% edit(wh);
% set(handles.edit5, 'String', wh)
%else
% warning('MATLAB:fileNotFound',...
% 'File was not foud : %s', filename);
% text=sprintf([num2str(i) 'Reessayer ! l\n']);
% set(handles.edit5, 'String', text)
[filename, pathname, filterindex] = uigetfile( ...
{ '*.txt','MAT-files (*.mat)'; ...
'*.*', 'All Files (*.*)'}, ...
'Choisir un fichier', ...
'MultiSelect', 'on');
load('ANALOG.txt');
load('DELTA.txt');
%filename
% Création de la structure de données
data = struct('name', [], 'file', [], 'value', []);
% Sauvegarde dans le workspace de la fenêtre
setappdata(handles.figure1, 'Data', data);
for i_file = 1:length(filename)
data = getappdata(handles.edit5, 'Data');
data.file = fullfile(pathname, filename{i_file});
data.value = load(data.file);
% Sauvegarde dans le workspace de la fenêtre
setappdata(handles.edit5, 'Data', data);
end |
Partager