how edit code in matlab

1 visualización (últimos 30 días)
work wolf
work wolf el 26 de Feb. de 2016
Editada: work wolf el 11 de Mzo. de 2016
how edit code matlab for change some comments
  2 comentarios
Walter Roberson
Walter Roberson el 26 de Feb. de 2016
That image is too small and too faint for me to read. Please post a more legible version. Assume that some of us are half blind.
James Tursa
James Tursa el 27 de Feb. de 2016
Do you have a specific function you are working with?

Iniciar sesión para comentar.

Respuesta aceptada

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

Más respuestas (1)

John BG
John BG el 27 de Feb. de 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
x=[0:.1:10]
f=@(x) sin(x)
y=f(x)
z=zeros(1,length(x)-1)
for i=2:length(x)
z(i)=(max(y(i),y(i-1))-min(y(i),y(i-1)))*(x(i)-x(i-1))
end
sum(z)
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
John

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by