Coding a First/Second Derivative Test in MATLAB?
조회 수: 1 (최근 30일)
이전 댓글 표시
This is my attempt at coding first/second derivative tests. I seem to be getting nothing out of my if-statement though. Any ideas/help would be greatly appreciated! Thank you all of course in advance
clc; clear; close all;
syms w tsig teps w1 w2
del = atan(w.*(tsig-teps)./(1+(w.^2.*(tsig.*teps))));
w_max = (teps*tsig).^(-1/2);
derv_del = diff(del,w)
derv_del0(w,tsig,teps) = derv_del;
derv_del_wmax = derv_del0(w_max,tsig,teps)
%First Derivative Test
lt(w1,w_max)
gt(w2,w_max)
if (isAlways(gt(derv_del0(w1,tsig,teps),0)) && isAlways(lt(derv_del0(w2,tsig,teps),0)))
disp('del has a maximum at the given w')
end
if (isAlways(lt(derv_del0(w1,tsig,teps),0)) && isAlways(gt(derv_del0(w2,tsig,teps),0)))
disp('del has a minimum at the given w')
end
%Second Derivative Test
derv_del02(w,tsig,teps) = diff(diff(derv_del))
derv_del_wmax2 = derv_del02(w_max,tsig,teps)
if (isAlways(lt(derv_del_wmax2,0)))
disp('del has a maximum at the given w')
end
if (isAlways(gt(derv_del_wmax2,0)))
disp('del has a minimum at the given w')
end
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Genomics and Next Generation Sequencing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!