MATLAB Answers

how edit code in matlab

29 views (last 30 days)
work wolf
work wolf on 26 Feb 2016
Edited: work wolf on 11 Mar 2016
how edit code matlab for change some comments
James Tursa
James Tursa on 27 Feb 2016
Do you have a specific function you are working with?

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 27 Feb 2016
sum( abs(diff(f(x))) .* diff(x) )

More Answers (1)

John BG
John BG on 27 Feb 2016
assuming you have sampled often enough to catch the true max min values, to avoid missing max or min when searching for U and L within [x(i) x(i+1)] then define reference vector x
f=@(x) sin(x)
for i=2:length(x)
redefine x and the function f to your values of interest.
If you find this answer of any help solving this question, please click on the thumbs-up vote link,
thanks in advance


No tags entered yet.

Community Treasure Hunt

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

Start Hunting!

Translated by