someone help me plzzz :(
Show older comments
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 Comment
madhan ravi
on 24 Dec 2018
Edited: madhan ravi
on 24 Dec 2018
isn't https://www.mathworks.com/matlabcentral/answers/437029-help-me-to-find-max the same question ?
Accepted Answer
More Answers (1)
KSSV
on 24 Dec 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
Categories
Find more on Assumptions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!