mirror of
https://github.com/c-sooyoung/fold_slice.git
synced 2026-09-17 19:39:08 +09:00
added ptychography scripts
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
function par = parameter_builder(parfile)
|
||||
|
||||
par = struct;
|
||||
fileID = fopen(parfile, 'r');
|
||||
tline = fgetl(fileID);
|
||||
while ischar(tline)
|
||||
tline = fgetl(fileID);
|
||||
if tline == -1
|
||||
break;
|
||||
end
|
||||
% disp(tline);
|
||||
temp = split(tline);
|
||||
if size(temp, 1) == 1 || temp{1,1}(1) == '#'
|
||||
continue
|
||||
end
|
||||
if ~isnan(str2double(temp{2,1}))
|
||||
par.(temp{1,1}) = str2double(temp{2,1});
|
||||
else
|
||||
par.(temp{1,1}) = temp{2,1};
|
||||
end
|
||||
end
|
||||
% fclose(fileID);
|
||||
% save( parfile, "par");
|
||||
end
|
||||
Reference in New Issue
Block a user