clc
close all
clear

    d = dir('*.csv');
    
for i = length(d):-1:1
    Dstr_max_structure(i).name = d(i).name;
    Dstr_max_structure(i).matrix = csvread(d(i).name);
    
    M = Dstr_max_structure(i).matrix;
    
    if (size(M,2) == 3)
    MM = [ (M(:,1) - M(1,1)) , M(:,2) , M(:,3) ];
    end
    
    if (size(M,2) == 4)
    MM = [ (M(:,1) - M(1,1)) , M(:,2) , M(:,3) , M(:,4) ];
    end
    
    
    if (size(M,2) == 5)
    MM = [ (M(:,1) - M(1,1)) , M(:,2) , M(:,3) , M(:,4) , M(:,5) ];
    end
    
    csvwrite( strcat('_', d(i).name) ,MM);
    
   % d(i).name
    
%    strcat('_' , d(i).name)
    
end