klus.tools module

klus.tools.indexS2M(sInd, dims)[source]

Single- to multi-index.

klus.tools.indexM2S(mInd, dims)[source]

Multi- to single-index.

klus.tools.printVector(x, name=None, k=8)[source]

Prints the vector like Matlab.

klus.tools.printMatrix2(x, name=None, k=8)[source]

Prints the matrix like Matlab.

klus.tools.printMatrix(x, name=None, row=3, col=5)[source]

Prints the matrix like Matlab.

class klus.tools.Timer(name=None)[source]

Bases: object

class klus.tools.matmux[source]

Bases: object

Communicate with a running Matlab session, which needs to be started via: $ tmux new -s matlab "matlab -nodesktop"

exportVars(*args)[source]

Export variables to Matlab, e.g.: x = 1 y = 2 this.exportVars('x', x, 'y', y)

importVars(*args)[source]

Import variables from Matlab, e.g.: x, y = this.importVars('x', 'y')

figure(i=-1)[source]
close(i=-1)[source]
plot(x, y)[source]
surf(x, y, z)[source]
scatter(x, y, c)[source]
scatter3(x, y, z, c)[source]
pcolor(x, y, z)[source]
imagesc(x)[source]
plotDomain(Omega, x)[source]