Coding a First/Second Derivative Test in MATLAB?

2 ビュー (過去 30 日間)
David
David 2014 年 3 月 4 日
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 件)

カテゴリ

Help Center および File ExchangeGenomics and Next Generation Sequencing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by