summaryrefslogtreecommitdiff
path: root/2048/DEPENDENCIES/transp.sci
diff options
context:
space:
mode:
Diffstat (limited to '2048/DEPENDENCIES/transp.sci')
-rwxr-xr-x2048/DEPENDENCIES/transp.sci17
1 files changed, 17 insertions, 0 deletions
diff --git a/2048/DEPENDENCIES/transp.sci b/2048/DEPENDENCIES/transp.sci
new file mode 100755
index 000000000..39854c9ce
--- /dev/null
+++ b/2048/DEPENDENCIES/transp.sci
@@ -0,0 +1,17 @@
+// function [P,degP] = transp(Q,degQ)
+// MATLAB FUNCTION transp TO TRANSPOSE
+// A POLYNOMIAL MATRIX
+
+// H. Kwakernaak, July, 1990
+
+function [P,degP] = transp(Q,degQ)
+
+[rQ,cQ] = polsize(Q,degQ);
+
+rP = cQ; cP = rQ; degP = degQ;
+P = zeros(rP,(degP+1)*cP);
+for i = 1:degP+1
+ P(:,(i-1)*cP+1:i*cP) = Q(:,(i-1)*cQ+1:i*cQ)';
+end
+
+endfunction;