bugGNU Octave - Bugs: bug #35589, Incorrect behavior of vertical...

 
 

bug #35589: Incorrect behavior of vertical concatenation array operator in >2 dimensions

Submitted by:  Nir Krakauer <nir_krakauer>
Submitted on:  Wed 22 Feb 2012 07:24:19 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: DuplicateAssigned to: None
Originator Name: Nir KrakauerOpen/Closed: Closed
Release: 3.4.0Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Wed 22 Feb 2012 07:33:00 PM UTC, comment #1:

This is an old bug (bug #32683) that has already been fixed.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Wed 22 Feb 2012 07:24:19 PM UTC, original submission:

cat gives the correct vertical concatenation behavior for N-D arrays. For example,

A = cat(1, ones(1, 5, 2), 2*ones(1, 5, 2))

returns

A =

ans(:,:,1) =

1 1 1 1 1
2 2 2 2 2

ans(:,:,2) =

1 1 1 1 1
2 2 2 2 2

However, using a semicolon, which should be equivalent to cat(1, ..) according to the manual and which does work in 2-D, leads to garbage:

A = [ones(1, 5, 2); 2*ones(1, 5, 2)]
A =

ans(:,:,1) =

2.0000e+00 2.0000e+00 2.0000e+00 2.0000e+00 2.0000e+00
2.6744e-316 2.4173e-316 2.4189e-316 2.4072e-316 2.3905e-316

ans(:,:,2) =

2.0000e+00 2.0000e+00 2.0000e+00 2.0000e+00 2.0000e+00
2.4189e-316 2.4190e-316 2.4190e-316 2.4190e-316 2.4190e-316

(The exact garbage returned changes from call to call.)

On the other hand, using the comma for concatenation along the second dimension gives the same results as cat(2, ..), as expected.

Nir Krakauer <nir_krakauer>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by nir_krakauer (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 22 Feb 2012 07:33:00 PM UTCjordighStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1