The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 9,850
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" <> 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...


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

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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.