Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
sort complex number in matlab r2009b

Subject: sort complex number in matlab r2009b

From: johnson ?

Date: 2 Dec, 2009 05:32:02

Message: 1 of 12

p = [1,11-i;2,2;3,3;4,4;5,5;6,6;7,7;8,8;9,9;10,10;11,11];
sort(p)

ans =

  1.000000000000000 2.000000000000000 - 1.000000000000000i
  2.000000000000000 3.000000000000000
  3.000000000000000 4.000000000000000
  4.000000000000000 5.000000000000000
  5.000000000000000 6.000000000000000
  6.000000000000000 7.000000000000000
  7.000000000000000 8.000000000000000
  8.000000000000000 9.000000000000000
  9.000000000000000 10.000000000000000
 10.000000000000000 11.000000000000000
 11.000000000000000 11.000000000000000

something wrong with the function 'sort', only in r2009b.

Subject: sort complex number in matlab r2009b

From: Bruno Luong

Date: 2 Dec, 2009 06:56:02

Message: 2 of 12

"johnson ?" <zxjohnson@gmail.com> wrote in message <hf4u4i$t93$1@fred.mathworks.com>...
> p = [1,11-i;2,2;3,3;4,4;5,5;6,6;7,7;8,8;9,9;10,10;11,11];
> sort(p)
>
> ans =
>
> 1.000000000000000 2.000000000000000 - 1.000000000000000i
> 2.000000000000000 3.000000000000000
> 3.000000000000000 4.000000000000000
> 4.000000000000000 5.000000000000000
> 5.000000000000000 6.000000000000000
> 6.000000000000000 7.000000000000000
> 7.000000000000000 8.000000000000000
> 8.000000000000000 9.000000000000000
> 9.000000000000000 10.000000000000000
> 10.000000000000000 11.000000000000000
> 11.000000000000000 11.000000000000000
>
> something wrong with the function 'sort', only in r2009b.

Confirmed. Yet another bug in such a fundamental function. :-(

Let me try to count, there is the

1. random matrix product result for large size monothread
http://www.mathworks.com/support/bugreports/583308

2. the complex transpose/product bug reported yesterday
http://www.mathworks.com/support/bugreports/583443

3. A logical indexing of sparse still not resolved
http://www.mathworks.com/matlabcentral/newsreader/view_thread/266610#696877

4. This one

Serious testing seems be neglected lately. TMW should refrain to release new version twice a year if they can't handle it correctly.

Bruno

Subject: sort complex number in matlab r2009b

From: Pekka Kumpulainen

Date: 2 Dec, 2009 08:30:20

Message: 3 of 12

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <
> Confirmed. Yet another bug in such a fundamental function. :-(
>
> Let me try to count, there is the
>
> 1. random matrix product result for large size monothread
> http://www.mathworks.com/support/bugreports/583308
>
> 2. the complex transpose/product bug reported yesterday
> http://www.mathworks.com/support/bugreports/583443
>
> 3. A logical indexing of sparse still not resolved
> http://www.mathworks.com/matlabcentral/newsreader/view_thread/266610#696877
>
> 4. This one
>
> Serious testing seems be neglected lately. TMW should refrain to release new version twice a year if they can't handle it correctly.
>
> Bruno

5. Doesn't work with vpn connection. Bug ID 582876.

This one has saved most of us here from the other bugs. Still using 2009a.

Subject: sort complex number in matlab r2009b

From: Lars

Date: 2 Dec, 2009 13:53:02

Message: 4 of 12

Hi,

Bruno Luong wrote
> Confirmed. Yet another bug in such a fundamental function. :-(
> Let me try to count, there is the
> 1. random matrix product ...
> 2. the complex transpose/product bug ...
> 3. A logical indexing of sparse still not resolved ...
   4. Complex sort does not aways work properly ...

> Serious testing seems be neglected lately. TMW should refrain to
> release new version twice a year if they can't handle it correctly.

Seconded!

If fundamental functionality cannot be trusted upon we (where I work)
are very soon going shopping for alternatives. Things like these we cannot
afford too just take light-heartedly.

Personally, I am under the impression that a lot of effort is going into
building MATLAB tall and wide, but with little less attention given to
keeping the fundament up to task.

Pekka Kumpulainen then added
> 5. Doesn't work with vpn connection. Bug ID 582876.


Further, this is copied from the thread related to bug 2 above:

Michal Kvasnicka commenting the response from Steve Lord
SL>> Yes, this is a bug that manifests under certain very specific circumstances.
MK> your recommended workaround
MK> <SNIP>
MK> is a bit funny, because the problem is really serious and I really do not
MK> want to rewrite the entire programs just to be sure, that the matrix A
MK> does not fullfil your "very specific circumstances".
MK> I am expecting the fix patch or something similar.

Yes, and the fix/patch should not have release number R2010a. Serious and fundamental bugs deserves to be handled in an out-of-the-ordinary-workflow
manner by TMW, because this is precisely what they are causing at the
customer end. And, suggesting modifications to user's code base as workarounds
for bugs in very basic ML functions, that may appear at very many places, just
ignores the risk/cost for mistakes and unforeseen side effects at that stage.

Not good.

I tend to recall the time when TMW within days distributed a patched version
of Matlab to isolate their users from the infamous Pentium bug (i.e. not even
a bug of their own making). And, yes, the word from the bug producer (Intel)
was that it was very specific and circumstances that almost never occured...



best
Lars

Subject: sort complex number in matlab r2009b

From: Bert Aerts (rm X)

Date: 3 Dec, 2009 06:40:59

Message: 5 of 12

johnson ? wrote:
> p = [1,11-i;2,2;3,3;4,4;5,5;6,6;7,7;8,8;9,9;10,10;11,11];
> sort(p)
>
> ans =
>
> 1.000000000000000 2.000000000000000 - 1.000000000000000i
> 2.000000000000000 3.000000000000000
> 3.000000000000000 4.000000000000000
> 4.000000000000000 5.000000000000000
> 5.000000000000000 6.000000000000000
> 6.000000000000000 7.000000000000000
> 7.000000000000000 8.000000000000000
> 8.000000000000000 9.000000000000000
> 9.000000000000000 10.000000000000000
> 10.000000000000000 11.000000000000000
> 11.000000000000000 11.000000000000000
>
> something wrong with the function 'sort', only in r2009b.

With Matlab 2009b on Mandriva Linux 2010.0 x86_64, I get the expected
result:

ans =

   1.0000 2.0000
   2.0000 3.0000
   3.0000 4.0000
   4.0000 5.0000
   5.0000 6.0000
   6.0000 7.0000
   7.0000 8.0000
   8.0000 9.0000
   9.0000 10.0000
  10.0000 11.0000
  11.0000 11.0000 - 1.0000i

Subject: sort complex number in matlab r2009b

From: Michal Kvasnicka

Date: 3 Dec, 2009 08:44:01

Message: 6 of 12

"Lars " <lars.barring@myworkplace.se> wrote in message <hf5rfu$g2$1@fred.mathworks.com>...
> Hi,
>
> Bruno Luong wrote
> > Confirmed. Yet another bug in such a fundamental function. :-(
> > Let me try to count, there is the
> > 1. random matrix product ...
> > 2. the complex transpose/product bug ...
> > 3. A logical indexing of sparse still not resolved ...
> 4. Complex sort does not aways work properly ...
>
> > Serious testing seems be neglected lately. TMW should refrain to
> > release new version twice a year if they can't handle it correctly.
>
> Seconded!
>
> If fundamental functionality cannot be trusted upon we (where I work)
> are very soon going shopping for alternatives. Things like these we cannot
> afford too just take light-heartedly.
>
> Personally, I am under the impression that a lot of effort is going into
> building MATLAB tall and wide, but with little less attention given to
> keeping the fundament up to task.
>
> Pekka Kumpulainen then added
> > 5. Doesn't work with vpn connection. Bug ID 582876.
>
>
> Further, this is copied from the thread related to bug 2 above:
>
> Michal Kvasnicka commenting the response from Steve Lord
> SL>> Yes, this is a bug that manifests under certain very specific circumstances.
> MK> your recommended workaround
> MK> <SNIP>
> MK> is a bit funny, because the problem is really serious and I really do not
> MK> want to rewrite the entire programs just to be sure, that the matrix A
> MK> does not fullfil your "very specific circumstances".
> MK> I am expecting the fix patch or something similar.
>
> Yes, and the fix/patch should not have release number R2010a. Serious and fundamental bugs deserves to be handled in an out-of-the-ordinary-workflow
> manner by TMW, because this is precisely what they are causing at the
> customer end. And, suggesting modifications to user's code base as workarounds
> for bugs in very basic ML functions, that may appear at very many places, just
> ignores the risk/cost for mistakes and unforeseen side effects at that stage.
>
> Not good.
>
> I tend to recall the time when TMW within days distributed a patched version
> of Matlab to isolate their users from the infamous Pentium bug (i.e. not even
> a bug of their own making). And, yes, the word from the bug producer (Intel)
> was that it was very specific and circumstances that almost never occured...
>
>
>
> best
> Lars
Just for your info. So, we must wait for next release R2010a!? This is the response from TMW Manager:

========================
Thanks to all the MATLAB Community members who have reported this bug and forwarded this information along.

We have posted this Bug (583443) in our Bug Report system:

http://www.mathworks.com/support/bugreports/

Look under MATLAB, in the Mathematics Category, Exists In R2009b.

MATLAB customers should feel free to Watch this Bug for any updates, or Subscribe to an RSS feed of a group of Bugs of interest.

This Bug Report details the circumstances required to trigger the bug.

The summary is that A must be the permutation of a full, square, non-scalar triangular matrix (but not exactly triangular) and must be used as A’\b in the solve.

The Bug Report does not yet reflect this, but the bug will be fixed in our next release of MATLAB.

Penny Anderson
Manager, MATLAB Math
The MathWorks
==================================

Subject: sort complex number in matlab r2009b

From: Penny Anderson

Date: 4 Dec, 2009 13:53:12

Message: 7 of 12

"Bert Aerts (rm X)" <bert.aertsX@advalvas.beX> wrote in message
news:4b175d7a$0$2865$ba620e4c@news.skynet.be...
> johnson ? wrote:
>> p = [1,11-i;2,2;3,3;4,4;5,5;6,6;7,7;8,8;9,9;10,10;11,11];
>> sort(p)
>>
>> ans =
>>
>> 1.000000000000000 2.000000000000000 -
>> 1.000000000000000i
>> 2.000000000000000 3.000000000000000
>> 3.000000000000000 4.000000000000000
>> 4.000000000000000 5.000000000000000
>> 5.000000000000000 6.000000000000000
>> 6.000000000000000 7.000000000000000
>> 7.000000000000000 8.000000000000000
>> 8.000000000000000 9.000000000000000
>> 9.000000000000000 10.000000000000000
>> 10.000000000000000 11.000000000000000
>> 11.000000000000000 11.000000000000000
>>
>> something wrong with the function 'sort', only in r2009b.
>
> With Matlab 2009b on Mandriva Linux 2010.0 x86_64, I get the expected
> result:
>
> ans =
>
> 1.0000 2.0000
> 2.0000 3.0000
> 3.0000 4.0000
> 4.0000 5.0000
> 5.0000 6.0000
> 6.0000 7.0000
> 7.0000 8.0000
> 8.0000 9.0000
> 9.0000 10.0000
> 10.0000 11.0000
> 11.0000 11.0000 - 1.0000i

Hi Bert,

This bug is Windows only.

See the Bug Report for more details:

http://www.mathworks.com/support/bugreports/search_results?search_executed=1&keyword=594221&release_filter=Exists+in&release=168&selected_products=1&category_filter%5B%5D=3#

Hope this helps,
  Penny.

Subject: bug: sort 3D data in r2009b along second dimension

From: John Melonakos

Date: 31 Dec, 2009 21:35:20

Message: 8 of 12

Here's another odd sorting bug below. Works in R2009A but fails R2009B (tested Linux/Mac, 32/64-bit).
  -jm

clear
echo on

computer
version

A = rand([3 100 10]);
A = sort(A,2); % sort it
[B I] = sort(A,2);
assert(all(A(:) == B(:))); % verify no difference (already sorted), PASS


A = rand([3 1000 10]);
A = sort(A,2); % sort it
[B I] = sort(A,2);
assert(all(A(:) == B(:))); % FAIL

Subject: bug: sort 3D data in r2009b along second dimension

From: Oleg Komarov

Date: 7 Mar, 2010 10:44:05

Message: 9 of 12

"John Melonakos" <john.melonakos@accelereyes.com> wrote in message <hhj5eo$j7i$1@fred.mathworks.com>...
> Here's another odd sorting bug below. Works in R2009A but fails R2009B (tested Linux/Mac, 32/64-bit).
> -jm
>
> clear
> echo on
>
> computer
> version
>
> A = rand([3 100 10]);
> A = sort(A,2); % sort it
> [B I] = sort(A,2);
> assert(all(A(:) == B(:))); % verify no difference (already sorted), PASS
>
>
> A = rand([3 1000 10]);
> A = sort(A,2); % sort it
> [B I] = sort(A,2);
> assert(all(A(:) == B(:))); % FAIL

Bug 6. !!??

Vista 32 R2008b --> OK
Server 2008 64 R009b --> FAILS

Apparently the bug is triggered only on the second dimension and whenever it reaches dimension 123...

col = 1;
while true
col = col+1;
    A2 = rand([2 col 2 2 2 2 2]);
A2 = sort(A2,2);
B2 = sort(A2,2);
    if ~all(A2(:) == B2(:))
        disp(col)
        return
    end
end

Oleg

Subject: bug: sort 3D data in r2009b along second dimension

From: Oleg Komarov

Date: 7 Mar, 2010 10:59:05

Message: 10 of 12

> Bug 6. !!??
>
> Vista 32 R2008b --> OK
> Server 2008 64 R009b --> FAILS
>
> Apparently the bug is triggered only on the second dimension and whenever it reaches dimension 123...
>
> col = 1;
> while true
> col = col+1;
> A2 = rand([2 col 2 2 2 2 2]);
> A2 = sort(A2,2);
> B2 = sort(A2,2);
> if ~all(A2(:) == B2(:))
> disp(col)
> return
> end
> end
>
> Oleg

WOW, there's something strange goign there, look at this pattern:
% Plot sort timings (2nd dimension)
for col = 1:300
    A2 = rand([10 col 100]);
    tic
    A2 = sort(A2,3);
    time(col) = toc;
end

plot(time)
http://drop.io/ipeqok8

Try to compare it with the plot of sort timings but on other dimensions!
Server 2008 win64 R2009b

Oleg

Subject: bug: sort 3D data in r2009b along second dimension

From: Oleg Komarov

Date: 7 Mar, 2010 11:46:05

Message: 11 of 12

> tic
> A2 = sort(A2,3);
> time(col) = toc;

typo, should be:
A2 = sort(A2,2);

Oleg

Subject: sort complex number in matlab r2009b

From: Dorian

Date: 21 Mar, 2010 07:05:33

Message: 12 of 12

"Michal Kvasnicka" <michal.kvasnicka@gmail.com> wrote in message <hf7toh$s06$1@fred.mathworks.com>...
> "Lars " <lars.barring@myworkplace.se> wrote in message <hf5rfu$g2$1@fred.mathworks.com>...
> > Hi,
> >
> > Bruno Luong wrote
> > > Confirmed. Yet another bug in such a fundamental function. :-(
> > > Let me try to count, there is the
> > > 1. random matrix product ...
> > > 2. the complex transpose/product bug ...
> > > 3. A logical indexing of sparse still not resolved ...
> > 4. Complex sort does not aways work properly ...
> >
> > > Serious testing seems be neglected lately. TMW should refrain to
> > > release new version twice a year if they can't handle it correctly.
> >
> > Seconded!
> >
> > If fundamental functionality cannot be trusted upon we (where I work)
> > are very soon going shopping for alternatives. Things like these we cannot
> > afford too just take light-heartedly.
> >
> > Personally, I am under the impression that a lot of effort is going into
> > building MATLAB tall and wide, but with little less attention given to
> > keeping the fundament up to task.
> >
> > Pekka Kumpulainen then added
> > > 5. Doesn't work with vpn connection. Bug ID 582876.
> >
> >
> > Further, this is copied from the thread related to bug 2 above:
> >
> > Michal Kvasnicka commenting the response from Steve Lord
> > SL>> Yes, this is a bug that manifests under certain very specific circumstances.
> > MK> your recommended workaround
> > MK> <SNIP>
> > MK> is a bit funny, because the problem is really serious and I really do not
> > MK> want to rewrite the entire programs just to be sure, that the matrix A
> > MK> does not fullfil your "very specific circumstances".
> > MK> I am expecting the fix patch or something similar.
> >
> > Yes, and the fix/patch should not have release number R2010a. Serious and fundamental bugs deserves to be handled in an out-of-the-ordinary-workflow
> > manner by TMW, because this is precisely what they are causing at the
> > customer end. And, suggesting modifications to user's code base as workarounds
> > for bugs in very basic ML functions, that may appear at very many places, just
> > ignores the risk/cost for mistakes and unforeseen side effects at that stage.
> >
> > Not good.
> >
> > I tend to recall the time when TMW within days distributed a patched version
> > of Matlab to isolate their users from the infamous Pentium bug (i.e. not even
> > a bug of their own making). And, yes, the word from the bug producer (Intel)
> > was that it was very specific and circumstances that almost never occured...
> >
> >
> >
> > best
> > Lars
> Just for your info. So, we must wait for next release R2010a!? This is the response from TMW Manager:
>
> ========================
> Thanks to all the MATLAB Community members who have reported this bug and forwarded this information along.
>
> We have posted this Bug (583443) in our Bug Report system:
>
> http://www.mathworks.com/support/bugreports/
http://www.wikio.com/article/bad-credit-payday-loans-176415445
>
> Look under MATLAB, in the Mathematics Category, Exists In R2009b.
>
> MATLAB customers should feel free to Watch this Bug for any updates, or Subscribe to an RSS feed of a group of Bugs of interest.
>
> This Bug Report details the circumstances required to trigger the bug.
>
> The summary is that A must be the permutation of a full, square, non-scalar triangular matrix (but not exactly triangular) and must be used as A’\b in the solve.
>
> The Bug Report does not yet reflect this, but the bug will be fixed in our next release of MATLAB.
>
> Penny Anderson
> Manager, MATLAB Math
> The MathWorks
> ==================================

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us