Update for bug #8319 73/12473/2
Charlotte HECQUET [Tue, 10 Sep 2013 06:41:27 +0000 (08:41 +0200)]
Change-Id: I66cc9d8b77a495de901e2b9698fb4bf7725b1073

scilab/modules/cacsd/macros/phasemag.sci
scilab/modules/cacsd/tests/nonreg_tests/bug_8319.dia.ref
scilab/modules/cacsd/tests/nonreg_tests/bug_8319.tst

index 349467a..c0c7c22 100644 (file)
@@ -35,10 +35,7 @@ function [phi,db]=phasemag(z,mod)
     end
     phi=phi*180/%pi //transform in degree
 
-    if typeof(z) == "hypermat" & typeof(phi) <> "hypermat" then
-        phi_temp=phi;
-        phi = mlist(["hm","dims","entries"]);
-        phi("dims") = [size(phi_temp,1) size(phi_temp,2)];
-        phi("entries") = matrix(phi_temp,size(phi_temp,1)*size(phi_temp,2),1);
+    if typeof(z) == "hypermat" then
+        phi = matrix(phi, size(z));
     end
 endfunction
index 2a8334e..b410537 100644 (file)
@@ -17,3 +17,4 @@ x = rand(2,2,2);
 c = x*(1+%i);
 [dB phi] = dbphi(c);
 assert_checktrue(typeof(phi) == 'hypermat');
+assert_checkequal(size(phi), size(x));
index 2cdcf59..e10ef2f 100644 (file)
@@ -19,3 +19,4 @@ x = rand(2,2,2);
 c = x*(1+%i);
 [dB phi] = dbphi(c);
 assert_checktrue(typeof(phi) == 'hypermat');
+assert_checkequal(size(phi), size(x));