summaryrefslogtreecommitdiff
path: root/macros/polyscale.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/polyscale.sci')
-rw-r--r--macros/polyscale.sci20
1 files changed, 19 insertions, 1 deletions
diff --git a/macros/polyscale.sci b/macros/polyscale.sci
index 9073e7a..019c08a 100644
--- a/macros/polyscale.sci
+++ b/macros/polyscale.sci
@@ -5,13 +5,31 @@
// where
//a is the vector containing the polynomial coefficients
// alpha is the scaling vector
+//
+//EXAMPLES:
+//to scale the seventh roots of unity ,x^7=1,
+////we represent
+//p=[1 0 0 0 0 0 0 -1] and changing the scaling factor,
+//b=polyscale(p,0.85)
+//EXPECTED OUTPUT:b=1. 0. 0. 0. 0. 0. 0. - 0.3205771
+
+
+//p=[1 0 0 0 0 0 0 -1] and changing the scaling factor,
+//b=polyscale(p,0.95)
+//EXPECTED OUTPUT:b=1. 0. 0. 0. 0. 0. 0. - 0.6983373
+//
+
+//p=[1 0 0 0 0 0 0 -1] and changing the scaling factor,
+//b=polyscale(p,1)
+//EXPECTED OUTPUT:b=1. 0. 0. 0. 0. 0. -1
+
// Author
//Debdeep Dey
function b = polyscale(a,alpha)
//errcheck1
if(min(size(a))>1) then
- error('Input polynomial must be an array')
+ error('Input polynomial must be an array')
end
if type(a)==10 then
error("Input cannot be of type char");