Friday, September 7, 2012

batch processing multiple files in matlab using for loop and uigetfile function

Recently I got a bunch of files that have the same format and structure and I need to use Matlab to process each file, which means carrying out the same calculation procedure to each file. Here's the code I created to do this.

% Import the file names
% The {*.csv} parameter indicates that only csv files will be shown in the file selection window
% Turn on the MultiSelect parameter so that multiple files can be selected at the same time
[filename, ~,~]=uigetfile({*.csv}, 'MultiSelect', 'on');
% now use a for loop to carry out same calculation procedure to each file
% the process_each_file is a function that does the calculation procedure
% before using the for loop, let's define a space to store all the outputs from each file calculation first
Re=zeros(length(filename),1);
for i = 1 : length(filename)
     Re(i)=process_each_file ( filename(i))
end




my-alpine and docker-compose.yml

 ``` version: '1' services:     man:       build: .       image: my-alpine:latest   ```  Dockerfile: ``` FROM alpine:latest ENV PYTH...