Skip to content

recommend change to start of diff() so it works generally #20

Description

@uoa1184615

Currently, diff(x) and diff(x,2) cause an error. This simple change to AutoDiff.m appears to at least allow diff() to do its job properly.

        function x = diff(x, n, dim)
            if nargin<3, dim=1; end %AJR, 28 May 2026
            if nargin<2, n=1;   end %AJR, 28 May 2026
            if n>1 %AJR, 28 May 2026, recursion probably inefficient
                x = diff(x,n-1,dim);
            end
            if issparse(x.values)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions