Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: compare elements of multiple arrays
Replies: 4   Last Post: Feb 20, 2014 10:42 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 7,891
Registered: 6/7/07
Re: compare elements of multiple arrays
Posted: Feb 20, 2014 1:28 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/20/2014 9:56 AM, Razieh wrote:
> "Steven Lord" <Steven_Lord@mathworks.com> wrote in message
>>
>> Store your data as a 6-by-5000 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 6-by-5000 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.

--



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.