someone help me plzzz :(
Afficher commentaires plus anciens
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 commentaire
madhan ravi
le 24 Déc 2018
Modifié(e) : madhan ravi
le 24 Déc 2018
isn't https://www.mathworks.com/matlabcentral/answers/437029-help-me-to-find-max the same question ?
Réponse acceptée
Plus de réponses (1)
KSSV
le 24 Déc 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
Catégories
En savoir plus sur Assumptions dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!