someone help me plzzz :(
이전 댓글 표시
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
madhan ravi
2018년 12월 24일
편집: madhan ravi
2018년 12월 24일
isn't https://www.mathworks.com/matlabcentral/answers/437029-help-me-to-find-max the same question ?
채택된 답변
추가 답변 (1개)
KSSV
2018년 12월 24일
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
카테고리
도움말 센터 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!