Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2725)  |  Call(2527)  |  Derive(10)  |  Import(188)
matrix(data, dtype=None, copy=True)

Returns a matrix from an array-like object, or from a string of data.
A matrix is a specialized 2-D array that retains its 2-D nature
through operations.  It has certain special operators, such as ``*``
(matrix multiplication) and ``**`` (matrix power).

Parameters
----------
data : array_like or string(more...)

src/s/k/Skogestad-Python-HEAD/Example_03_03.py   Skogestad-Python(Download)
import numpy as np
import matplotlib.pyplot as plt
 
d1 = np.matrix([[1], [0]])
d2 = np.matrix([[0], [1]])
d3 = np.matrix([[0.707], [0.707]])
d4 = np.matrix([[0.707], [-0.707]])
d5 = np.matrix([[0.6], [-0.8]])

src/n/i/nipy-0.3.0/nipy/labs/group/spatial_relaxation_onesample.py   nipy(Download)
            for k in L:
                if self.std == None:
                    datak = np.matrix(self.data[:, k].reshape(n, 1) - m_mean_j)
                    if self.vardata != None:
                        vark = self.vardata[:, k] + v_j
                else:
                    nk = int(self.N[k])
                    datak = np.matrix(data_I[cumsum[k] : cumsum[k + 1]].reshape(nk, 1) - m_mean_j)
                    if self.vardata != None:
                        vark = var_I[cumsum[k] : cumsum[k + 1]]
                Vk = np.matrix(np.zeros((nk, nk), float) + m_var_j)
                if self.vardata == None:
                    Vk[xrange(nk), xrange(nk)] = v_j + m_var_j

src/c/v/cvxpy-HEAD/examples/notebooks/simple_portfolio_data.py   cvxpy(Download)
pbar = (np.ones((n, 1)) * .03 +
        np.matrix(np.append(np.random.rand(n - 1, 1), 0)).T * .12)
S = np.matrix(np.random.randn(n, n))
S = S.T * S
S = S / np.max(np.abs(np.diag(S))) * .2
S[:, n - 1] = np.matrix(np.zeros((n, 1)))
S[n - 1, :] = np.matrix(np.zeros((1, n)))
x_unif = np.matrix(np.ones((n, 1))) / n

src/c/v/cvxpy-HEAD/examples/expr_trees/portfolio.py   cvxpy(Download)
pbar = (np.ones((n, 1)) * .03 +
        np.matrix(np.append(np.random.rand(n - 1, 1), 0)).T * .12)
S = np.matrix(np.random.randn(n, n))
S = S.T * S
S = S / np.max(np.abs(np.diag(S))) * .2
S[:, n - 1] = np.matrix(np.zeros((n, 1)))
S[n - 1, :] = np.matrix(np.zeros((1, n)))
x_unif = np.matrix(np.ones((n, 1))) / n

src/s/k/Skogestad-Python-HEAD/Example_04_04.py   Skogestad-Python(Download)
 
# Define state space matrices
A = np.matrix([[-2, -2],
               [0, -4]])
B = np.matrix([[1],
              [1]])
C = np.matrix([[1, 0]])
 
# Create frequency domain mode;
G = sign.lti(A, B, C, D)
 
# Question: Why does A.transpose give the same eigenvectors as the book

src/r/a/rawesome-HEAD/examples/carousel/carousel_crosswind_homotopy.py   rawesome(Download)
                phi += numpy.arcsin((1.3)/lineRadiusGuess)
                phi += 10*pi/180
                R_c2n = numpy.matrix([[  numpy.cos(phi), 0, numpy.sin(phi)],
                                      [               0, 1,              0],
                                      [ -numpy.sin(phi), 0, numpy.cos(phi)]])

src/r/a/rawesome-HEAD/examples/pumping_mode/pumping_homotopy.py   rawesome(Download)
                phi += numpy.arcsin((conf['minAltitude']+0.3)/lineRadiusGuess)
                phi += 10*pi/180
                R_c2n = numpy.matrix([[  numpy.cos(phi), 0, numpy.sin(phi)],
                                      [               0, 1,              0],
                                      [ -numpy.sin(phi), 0, numpy.cos(phi)]])

src/r/a/rawesome-HEAD/examples/drag_mode/drag_homotopy.py   rawesome(Download)
                phi += numpy.arcsin((conf['minAltitude']+0.3)/lineRadiusGuess)
                phi += 10*pi/180
                R_c2n = numpy.matrix([[  numpy.cos(phi), 0, numpy.sin(phi)],
                                      [               0, 1,              0],
                                      [ -numpy.sin(phi), 0, numpy.cos(phi)]])

src/s/k/Skogestad-Python-HEAD/Example_03_12.py   Skogestad-Python(Download)
 
 
G = np.matrix([[100, 0], [0, 1]])
 
[U, S, V] = np.linalg.svd(G)
 
R = RGA(G)
ItR = IterRGA(G, 4)
numR = RGAnumber(G)

src/c/v/cvxpy-HEAD/examples/geometry/separating_polyhedra.py   cvxpy(Download)
n = 2
m = 2*n
A1 = np.matrix("1 1; 1 -1; -1 1; -1 -1")
A2 = np.matrix("1 0; -1 0; 0 1; 0 -1")
b1 = 2*np.ones((m,1))
b2 = np.matrix("5; -3; 4; -2")
 
poly1 = cs.Polyhedron(A1, b1)
poly2 = cs.Polyhedron(A2, b2)

  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9  Next