初版gui
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
function results = load_results_mat(file_path)
|
||||
%LOAD_RESULTS_MAT Load results struct from a MAT file.
|
||||
|
||||
arguments
|
||||
file_path (1,:) char
|
||||
end
|
||||
|
||||
if ~exist(file_path, 'file')
|
||||
error('load_results_mat:FileNotFound', 'Results file not found: %s', file_path);
|
||||
end
|
||||
|
||||
data = load(file_path, '-mat');
|
||||
if ~isfield(data, 'results')
|
||||
error('load_results_mat:MissingResultsVariable', ...
|
||||
'MAT file does not contain variable ''results'': %s', file_path);
|
||||
end
|
||||
|
||||
results = data.results;
|
||||
@@ -0,0 +1,14 @@
|
||||
function save_results_mat(results, file_path)
|
||||
%SAVE_RESULTS_MAT Save results struct to a MAT file.
|
||||
|
||||
arguments
|
||||
results (1,1) struct
|
||||
file_path (1,:) char
|
||||
end
|
||||
|
||||
folder_path = fileparts(file_path);
|
||||
if ~isempty(folder_path) && ~exist(folder_path, 'dir')
|
||||
mkdir(folder_path);
|
||||
end
|
||||
|
||||
save(file_path, 'results', '-mat');
|
||||
Reference in New Issue
Block a user