bug 7095 fix, the margins unit_test fails, g_margin, p_margin and unit_test improved
[scilab.git] / scilab / modules / cacsd / macros / g_margin.sci
index a435d40..13d9bc0 100644 (file)
@@ -47,8 +47,9 @@ function [gm,fr]=g_margin(h)
   if k==[] then gm=%inf,fr=[],return,end
   mingain=abs(mingain(k));
   ws=abs(ws(k))// select positive frequency
-  //disp([ws,1/mingain])
+
   gm=-20*log(mingain)/log(10) //tranform into Db
-  [gm,k]=min(gm);ws=ws(k)//select the minimum
-  fr=ws/(2*%pi) 
+  [gm,k]=min(gm);ws=ws(k);//select the minimum
+
+  fr=ws/(2*%pi) //transform in Hz
 endfunction