Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - Русский - 日本語
Scilab Help >> Matlab to Scilab Conversion Tips > Matlab-Scilab equivalents > 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-2015 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jun 15 08:27:54 CEST 2016