Path: news.mathworks.com!not-for-mail
From: "Ulrik Nash" <uwn@sam.sdu.dk>
Newsgroups: comp.soft-sys.matlab
Subject: Changing values in array if they meet certain critria
Date: Thu, 17 Dec 2009 12:49:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 16
Message-ID: <hgd9c2$et9$1@fred.mathworks.com>
Reply-To: "Ulrik Nash" <uwn@sam.sdu.dk>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1261054146 15273 172.30.248.38 (17 Dec 2009 12:49:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 17 Dec 2009 12:49:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2106050
Xref: news.mathworks.com comp.soft-sys.matlab:593406

Hi everyone,

I have an array A with many numbers:

12
32
35
45
...
nth

Now I wish to change the numbers in the array, if they meet certain criteria, for example, if they are larger than 30, say. How do I do this without using a for loop?

Regards,

Ulrik.