Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - 日本語 - Русский
Aide de Scilab >> Code Matlab => Scilab > Equivalences Matlab -> Scilab > D > diff (Matlab function)

diff (Matlab function)

Differences and approximate derivatives

Matlab/Scilab equivalent

Matlab Scilab

Particular cases

Y = diff(X[,n])

For this kind of use of diff (dim parameter not given), Matlab works on the first non-singleton dimension of X what Scilab does not. In this case, Scilab considers dim to be "*" so that diff threats all values of X, what Matlab does not.

Y = diff(X,n,dim)

If dimension given by dim reaches 1 before n iterations have been done, Matlab switches to next non-singleton dimension, but Scilab does not, use mtlb_diff to get equivalent results.

When n is greater than all existing dimensions of X, Matlab returns [] what Scilab may not give for all inputs.

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Jan 03 14:33:08 CET 2022