forked from helgestein/htAx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcallbackChangeDB.m
34 lines (21 loc) · 905 Bytes
/
callbackChangeDB.m
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
function callbackChangeDB(obj, evt, file, specHandles)
%CALLBACKCHANGEDB allows the user to select a new set of database patterns
%to be compared with the experimental patterns
fSpecPlot = specHandles.fSpecPlot;
specInfo = fSpecPlot.UserData;
if file == 0
% import new database patterns from folder
XRDDatabaseFolder = uigetdir;
[collcodes, XRDDatabase] = readXRDDatabase(XRDDatabaseFolder);
specInfo.collcodes = collcodes;
specInfo.XRDDatabase = XRDDatabase;
else
% import new database patterns from file
[file, path] = uigetfile;
XRDDatabaseFile = strcat(path, file);
db = load(XRDDatabaseFile, '-mat');
specInfo.collcodes = db.collcodes;
specInfo.XRDDatabase = db.patterns;
end
fSpecPlot.UserData = specInfo;
end