Hamburger Hamburger

python Library

testNumpyMatrix

Keine Erläuterungen gefunden.

import  numpy as  np

x = np.ones(3)
M = np.zeros((2,3))

M[0,0] = 1
M[0,1] = 2
M[1,0] = 3
M[1,1] = 4

N = np.matrix([[1, 2, 0], [3, 4, 0]])
z1 = np.matrix( [1.0, 1.0, 1.0] )
z2 = np.matrix([[1.0], [1.0], [1.0]])


#number of elements in matrix:
print("size, No of entries:",M.size)

#number of elements in matrix:
print("shape M:",M.shape)
print("shape N:",N.shape)

NoRows, NoCols = M.shape
for  i in range(NoRows):
    for  j in range(NoCols):
        print("M",i,j, M[i,j], "\t N",i,j, N[i,j])
        #print("N",i,j, N[i,j])

y1 = np.dot(M, x)
print("y1:", y1)
y2 = N * z1.T
print("y2:", y2)
y3 = N * z2
print("y3:", y3)

Index of Library

1ArnesKonto.py
2CIEcolorCoordinates_Spectrum.py
3MatlabStructures.py
4ModelicaExecution.py
5ModelicaMatFilter.py
6OperateAllFiles.py
7dictionaryStatistics.py
8familienKonto.py
9makeDoc.py
10plotTimeSeries.py
11readData2DictOfArrays.py
12replaceInFile.py
13showPointOnCIExy.py
14svg2pdf.py
15testNumpyMatrix.py
16writeDictOfArrays.py
17writeTSV.py

Der gesamte Sourcecode darf gemäß GNU General Public License weiterverbreitet werden.