MATLAB: I had 200 .txt files each having four columns and 2000 rows . i want to import them into matlab and find average of each column .Please help me in coding this data importimporting .txt files * Best Answer d = dir('*.txt');nfiles = length(d);for k = 1:nfiles data = importdata(d(k).name);% get meanendDoc mean Related SolutionsMATLAB: Create a function to extract data several csv files Thank you so much for your answers!I will upload a file so you can see.What I need is to take the data from different columns and rows to work with them after. Example. Take C21:J532, C556:H1067, C1089:H1600After I will need to work on that matrix. MATLAB: Create vector from each element it had Method one: nonzeros:vec = [x,y,z];tmp = 1:max(vec);new = nonzeros((tmp(:)<=vec).*tmp(:)).' % requires >=R2016bMethod two: arrayfun:new = cell2mat(arrayfun(@(n)1:n,vec,'uni',0)) Related QuestionImportdata misses some of the data in the fileMean of each column entry
Best Answer