# bug #53178: Circshift incompatibility with MATLAB

 Submitted by: Ceral Paquet Submitted on: Sat 17 Feb 2018 03:00:22 PM UTC Category: Octave Function Severity: 3 - Normal Priority: 5 - Normal Item Group: Matlab Compatibility Status: None Assigned to: None Originator Name: Open/Closed: Open Release: 4.2.1 Operating System: GNU/Linux

You are not logged in

Sun 18 Mar 2018 01:57:01 PM UTC, comment #4:

Sorry that logic was busted, trying to be clever. This is a simpler fix for scalar "n" arguments.

diff circshift.m circshift_new.m

< function y = circshift (x, n, dim)
---

> function y = circshift_new (x, n, dim)

75a76,81

> if (isscalar (n))
> ## Find the first non-singleton dimension.
> (dim = find (sz > 1, 1)) || (dim = 1);
> n = [zeros(1, dim-1), n];
> end
>

Ceral Paquet <octavebugs>
Thu 15 Mar 2018 10:14:36 PM UTC, comment #3:

The diff was kind of terse! ;) In context:

Ceral Paquet <octavebugs>
Thu 15 Mar 2018 10:11:27 PM UTC, comment #2:

This change to circshift.m allows a scalar "n" argument that acts along the first non-singleton dimension.

Ceral Paquet <octavebugs>
Sat 17 Feb 2018 03:23:28 PM UTC, comment #1:

Aha, now I see why this never bit us before!

Ceral Paquet <octavebugs>
Sat 17 Feb 2018 03:00:22 PM UTC, original submission:

With a vector input and singleton shift argument, MATLAB always shifts whereas Octave respects the dimension.

MATLAB 2017a

Octave 4.2.1

Ceral Paquet <octavebugs>

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

Attach Files:

Comment:

No files currently attached

Depends on the following items: None found

Items that depend on this one: None found

Carbon-Copy List
• -email is unavailable- added by mtmiller (Updated the item)
• -email is unavailable- added by octavebugs (Submitted the item)
•

Do you think this task is very important?
This task has 0 encouragements so far.

Only project members can vote.