Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


dpb
Posts:
9,085
Registered:
6/7/07


Re: compare elements of multiple arrays
Posted:
Feb 20, 2014 1:28 PM


On 2/20/2014 9:56 AM, Razieh wrote: > "Steven Lord" <Steven_Lord@mathworks.com> wrote in message >> >> Store your data as a 6by5000 array then call MIN and MAX on that >> array, specifying dim input 1 to take the minimum or maximum for each >> column. > > > Dear Steve, can you help me how to store data as a 6by5000 array. My > 5000 arrays are result of 5000 runs and I do not know how to combine > them in one array. The second part of your answer regarding call max/min > is already understood.thanks
One presumes you saved them as files? If so use the techniques discussed at the FAQ to reload them and when you do, build the array by populating each row in turn...
<http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F>
An outline of one of those methods...
d=dir('basename*.dat'); % Presume a wise name choice to allow selection nfiles=length(d); % in case it's actually 4999 or 5001 or 2... x=zeros(nfiles,6); % preallocate for i=1:length(d) x(i,:)=textread(d(i).name); % stored as row vector/transpose if column end
Now do your min/max operations.




