-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Zip all the simulations and remove the FEM folder. Having thousands of file in a folder is a mess (file explorer, search, etc.)
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function get_zip(folder_fem) | ||
% Assemble many FEM simulation into a zip file and remove the folder. | ||
% | ||
% Parameters: | ||
% folder_fem (str): path of the folder where the results are stored | ||
% | ||
% (c) 2019-2020, ETH Zurich, Power Electronic Systems Laboratory, T. Guillod | ||
|
||
% get MATLAB file in the directory | ||
filelist = dir([folder_fem filesep() '*.mat']); | ||
assert(isempty(filelist)==false, 'invalid data') | ||
|
||
% get name | ||
file_fem = [folder_fem '.zip']; | ||
for i=1:length(filelist) | ||
filelist_cell{i} = [filelist(i).folder filesep() filelist(i).name]; | ||
end | ||
|
||
% zip data | ||
zip(file_fem, filelist_cell); | ||
|
||
% remove folder | ||
[s, m] = rmdir(folder_fem, 's'); | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters