octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Squeeze works differently in Matlab


From: Andy Adler
Subject: Squeeze works differently in Matlab
Date: Fri, 2 Jul 2004 23:09:43 -0400 (EDT)

I'm trying to get some code to run under Matlab and Octave,
and I note that 'squeeze' works differently, if there is only
one non-singleton dimention:

Matlab:
    >> squeeze(rand(2,1,3))
    ans =
        0.4447    0.7919    0.7382
        0.6154    0.9218    0.1763

    >> squeeze(rand(1,1,3))
    ans =
        0.4057
        0.9355
        0.9169

Octave (2.1.57 - today's CVS):
    octave:1> squeeze(rand(2,1,3)) # This is OK
    ans =
      0.47701  0.72476  0.80614
      0.64084  0.87862  0.71905

    octave:2> squeeze(rand(1,1,3)) # This is transposed wrt Matlab
    ans =
      0.839686  0.112393  0.016944

Andy




reply via email to

[Prev in Thread] Current Thread [Next in Thread]