Quantcast
Channel: Math.NET Numerics
Viewing all articles
Browse latest Browse all 971

New Post: Example of Usage in PowerShell 2.0

$
0
0
Thanks for sharing, I published a PowerShell module that does that with a little bit of syntactic tricks to make using Math.Net with PowerShell easier, please feel free to check it out, your feedback is always welcome.

https://mathnetpowershell.codeplex.com/

Here is a sample code/output:

PS C:> $m = m "1 5;5 9"
PS C:> $m

SparseMatrix 2x2-Single 100.00 % Filled
       1            5
       5            9

PS C:> $n = i 2
PS C:> $n

SparseMatrix 2x2-Single 50.00 % Filled
       1            0
       0            1

PS C:> $n[1,1]=2
PS C:> $n

SparseMatrix 2x2-Single 50.00 % Filled
       1            0
       0            2

PS C:> inv $n

SparseMatrix 2x2-Single 50.00 % Filled
       1            0
       0          0.5

PS C:> $p = $m * $n
PS C:> $p

SparseMatrix 2x2-Single 100.00 % Filled
       1           10
       5           18

PS C:> trc $p
19
PS C:> det $p
-32
PS C:> t $p

SparseMatrix 2x2-Single 100.00 % Filled
       1            5
      10           18

PS C:> m "1 0" | t

SparseMatrix 2x1-Single 50.00 % Filled
       1
       0

PS C:> m -rows 2 -columns 1

SparseMatrix 2x1-Single 0.00 % Filled
       0
       0

PS C:> $o = m -matrixFile Samples\sampleMatrix.txt
PS C:> $o

SparseMatrix 3x3-Single 100.00 % Filled
       1            5            6
       7            8            9
       6            5            4

PS C:> $o.Diagonal()
1
8
4

Viewing all articles
Browse latest Browse all 971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>