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 - 日本語

Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
See the recommended documentation of this function

Aide Scilab >> Aide à la conversion Matlab vers Scilab > 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-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Oct 05 12:11:03 CEST 2011