Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: shifting data within a vector
Date: Mon, 5 May 2008 22:58:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 14
Message-ID: <fvo3dr$8qk$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210028283 9044 172.30.248.37 (5 May 2008 22:58:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 May 2008 22:58:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1376919
Xref: news.mathworks.com comp.soft-sys.matlab:466797



For a vector s, I found its maximum value, and located it

s=rand(20,1);
max(s);
find(s==max(s));


Now I want to add a value of say x=10; to the max(s) and 
place it in the following row(raw after max(s)), then add 
a value of 20 to the max(s)and add it to the following 
raw....etc till the end raw?

Any suggestions?