Path: news.mathworks.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!news.mathforum.org!not-for-mail
From: Arthur <artnaz@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Go from end to start of array
Date: Fri, 20 Feb 2009 10:15:29 EST
Organization: The Math Forum
Lines: 16
Message-ID: <23120260.1235142966555.JavaMail.jakarta@nitrogen.mathforum.org>
References: <gnl8od$4jk$1@fred.mathworks.com>
NNTP-Posting-Host: nitrogen.mathforum.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: support1.mathforum.org 1235142966 5315 144.118.30.135 (20 Feb 2009 15:16:06 GMT)
X-Complaints-To: news@news.mathforum.org
NNTP-Posting-Date: Fri, 20 Feb 2009 15:16:06 +0000 (UTC)
Xref: news.mathworks.com comp.soft-sys.matlab:519710

Thanks a lot for the input, but it doesn't give the correct output. And I don't know where you got this from:

>if m == 1
>a = n;

For example, if n=5 and m=1, we get:

[ 1 2 3 4 5 ]
[ 2 3 4 5 ]
[ 2 4 5 ]
[ 2 4 ]
[ 2 ]

And the rest of it doesn't give the correct answer either. Maybe you forgot to start deleting with '1'?

Other than that, I'm afraid I don't understand the theory behind your algorithm on first sight. But maybe that when you have corrected it I could figure it out myself...