Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.0 - Français

Change language to:
English - 日本語 - Português

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

Manuel 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.

<< diary (Matlab function) D dir (Matlab function) >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jan 26 16:24:17 CET 2011