how to write equation in matlab ?

Réponses (1)

KSSV
KSSV le 23 Nov 2021

0 votes

If x is your series.
N = length(x) ;
FI = sum(abs(diff(x)))/N ;

5 commentaires

Deepu S S
Deepu S S le 23 Nov 2021
may i know 'abs' means?
help abs
ABS Absolute value. ABS(X) is the absolute value of the elements of X. When X is complex, ABS(X) is the complex modulus (magnitude) of the elements of X. See also SIGN, ANGLE, UNWRAP, HYPOT. Documentation for abs doc abs Other functions named abs codistributed/abs duration/abs iddata/abs sym/abs dlarray/abs gpuArray/abs
Deepu S S
Deepu S S le 23 Nov 2021
@KSSV how to write the above equation in matlab?
I guess you figured it out since you accepted the answer (remove the division by N), but here is the answer assuming N is the length of the x vector:
FI = sum(abs(diff(x)));
or more accurately, assuming we just want to sum up to N and we have no idea how many elements are in x (might be N or might be something else):
FI = sum(abs(diff(x(1:N))))
Deepu S S
Deepu S S le 24 Nov 2021
Thank you @Image Analyst...now its working

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Centre d'aide et File Exchange

Question posée :

le 23 Nov 2021

Commenté :

le 24 Nov 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by