Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!newsfeed.stanford.edu!newshub.sdsu.edu!flph200.ffdc.sbc.com!prodigy.net!flph199.ffdc.sbc.com!prodigy.com!flpi107.ffdc.sbc.com!nlpi067.nbdc.sbc.com.POSTED!ffbda4aa!not-for-mail
Reply-To: "Nasser Abbasi" <nma@12000.org>
From: "Nasser Abbasi" <nma@12000.org>
Newsgroups: comp.soft-sys.matlab
References: <giu681$21u$1@fred.mathworks.com> <9rx4l.15441$ZP4.9441@nlpi067.nbdc.sbc.com> <giuamh$q9o$1@fred.mathworks.com> <B9y4l.15443$ZP4.6360@nlpi067.nbdc.sbc.com> <giuegd$noo$1@fred.mathworks.com>
Subject: Re: How to find maximum values in a matrix
Lines: 60
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350
X-RFC2646: Format=Flowed; Original
Message-ID: <m7z4l.15448$ZP4.7004@nlpi067.nbdc.sbc.com>
NNTP-Posting-Host: 75.40.51.98
X-Complaints-To: abuse@prodigy.net
X-Trace: nlpi067.nbdc.sbc.com 1230159442 ST000 75.40.51.98 (Wed, 24 Dec 2008 17:57:22 EST)
NNTP-Posting-Date: Wed, 24 Dec 2008 17:57:22 EST
Organization: at&t http://my.att.net/
X-UserInfo1: F[OORWKGFPB[G]I]OBNLNQMAPJYRE_LHCIXNMRQIMASJETAANVW[AKWZE\]^XQWIGNE_[EBL@^_\^JOCQ^RSNVLGTFTKHTXHHP[NB\_C@\SD@EP_[KCXX__AGDDEKGFNB\ZOKLRNCY_CGG[RHT_UN@C_BSY\G__IJIX_PLSA[CCFAULEY\FL\VLGANTQQ]FN
Date: Wed, 24 Dec 2008 14:57:14 -0800
Xref: news.mathworks.com comp.soft-sys.matlab:508705


"Abdul " <spacian1@hotmail.com> wrote in message 
news:giuegd$noo$1@fred.mathworks.com...


> Hi Naseer,
>
> After running the program through M-file (trial.m), it gives all below 
> with error message:
>
> echo on
> A=[1218,198;1218,22;1218,1441;1218,28;1219,34;1219,1789]
>
> A =
>
>        1218         198
>        1218          22
>        1218        1441
>        1218          28
>        1219          34
>        1219        1789
>
> B=sortrows(A,-2)
>
> B =
>
>        1219        1789
>        1218        1441
>        1218         198
>        1219          34
>        1218          28
>        1218          22
>
> [v,I]=unique(B(:,1),'first')
> ??? Error using ==> unique
> Unknown flag.
>
> Error in ==> trial at 6
> [v,I]=unique(B(:,1),'first')
>
> Regards and thanks a lot,
>
> Abdul

Strange. I do not get this error on Matlab 2008b

Can you type the command

EDU>> which unique
C:\Program Files\MATLAB\R2008b Student\toolbox\matlab\ops\unique.m
EDU>>

And see what you get?
Which version of Matlab and which Platform you have?

May be this flag to unique was added in later version than what you have.

--Nasser