someone help me plzzz :(
Mostrar comentarios más antiguos
tic
syms x y;
f(x) = (2.*x-1).*sin(pi.*x);
for i=1:25
y(i)=diff(f(x),i);
end
fun=matlabFunction(y');
x=-2:0.01:1;
result=fun(x);
maxres = max(result,[],2)
for i=1:25
if maxres(i)<0.001
break
end
end
someone can tell me the way to find max y(i) = diff (f(x),i) in every step and check it
if max(y(i))< 0.001 then stop the loop
1 comentario
madhan ravi
el 24 de Dic. de 2018
Editada: madhan ravi
el 24 de Dic. de 2018
isn't https://www.mathworks.com/matlabcentral/answers/437029-help-me-to-find-max the same question ?
Respuesta aceptada
Más respuestas (1)
KSSV
el 24 de Dic. de 2018
f= @(x) (2.*x-1).*sin(pi.*x);
x=-2:0.01:1;
for i=1:25
y=diff(f(x),i);
if max(y)<0.001
break
end
end
Categorías
Más información sobre Assumptions en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!