how to write equation in matlab ?

답변 (1개)

KSSV
KSSV 2021년 11월 23일

0 개 추천

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

댓글 수: 5

Deepu S S
Deepu S S 2021년 11월 23일
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 2021년 11월 23일
@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 2021년 11월 24일
Thank you @Image Analyst...now its working

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2021년 11월 23일

댓글:

2021년 11월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by