Coding a First/Second Derivative Test in MATLAB?
2 次查看(过去 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!