iPython provides a rich browser-based interactive notebook with support for code, text, mathematical expressions,
inline plots and other rich media. IfSharp, developed by Bayard Rock, is an F# profile
for iPython with IntelliSense and embedded FSharp.Charting. Thanks to its NuGet support it can load other packages like Math.NET Numerics on demand.

Follow the instructions at IfSharp/Installation.
Essentially:
Install Anaconda
-
In a shell, run
conda update conda
conda update ipython
Install IfSharp.
By itself IfSharp does not know how to display matrices and vectors in a nice way, but we can tell it how to do so by providing our own display printers for them.
Since v3.3 the Math.NET Numerics F# package includes a script MathNet.Numerics.IfSharp.fsx to do so.
Unfortunately loading this script requires the exact version in the path - if you know a way to avoid this please let us know.

Alternatively you can also use the code below and adapt it to your needs, e.g. if you want it to show more rows.
open MathNet.Numerics.LinearAlgebra
let inline (|Float|_|) (v:obj) =
if v :? float then Some(v :?> float) else None
let inline (|Float32|_|) (v:obj) =
if v :? float32 then Some(v :?> float32) else None
let inline (|PositiveInfinity|_|) (v: ^T) =
if (^T : (static member IsPositiveInfinity: 'T -> bool) (v))
then Some PositiveInfinity else None
let inline (|NegativeInfinity|_|) (v: ^T) =
if (^T : (static member IsNegativeInfinity: 'T -> bool) (v))
then Some NegativeInfinity else None
let inline (|NaN|_|) (v: ^T) =
if (^T : (static member IsNaN: 'T -> bool) (v))
then Some NaN else None
let inline formatMathValue (floatFormat:string) = function
| PositiveInfinity -> "\\infty"
| NegativeInfinity -> "-\\infty"
| NaN -> "\\times"
| Float v -> v.ToString(floatFormat)
| Float32 v -> v.ToString(floatFormat)
| v -> v.ToString()
let inline formatMatrix (matrix: Matrix<'T>) =
String.concat Environment.NewLine
[ "\\begin{bmatrix}"
matrix.ToMatrixString(10,4,7,2,"\\cdots","\\vdots","\\ddots",
" & ", "\\\\ " + Environment.NewLine, (fun x -> formatMathValue "G4" x))
"\\end{bmatrix}" ]
let inline formatVector (vector: Vector<'T>) =
String.concat Environment.NewLine
[ "\\begin{bmatrix}"
vector.ToVectorString(12, 80, "\\vdots", " & ", "\\\\ " + Environment.NewLine,
(fun x -> formatMathValue "G4" x))
"\\end{bmatrix}" ]
App.AddDisplayPrinter (fun (x:Matrix<float>) ->
{ ContentType = "text/latex"; Data = formatMatrix x })
App.AddDisplayPrinter (fun (x:Matrix<float32>) ->
{ ContentType = "text/latex"; Data = formatMatrix x })
App.AddDisplayPrinter (fun (x:Vector<float>) ->
{ ContentType = "text/latex"; Data = formatVector x })
App.AddDisplayPrinter (fun (x:Vector<float32>) ->
{ ContentType = "text/latex"; Data = formatVector x })
val v : obj
type obj = System.Object
<summary>An abbreviation for the CLI type <see cref="T:System.Object" />.</summary>
<category>Basic Types</category>
Multiple items
val float : value:'T -> float (requires member op_Explicit)
<summary>Converts the argument to 64-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using <c>Double.Parse()</c>
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.</summary>
<param name="value">The input value.</param>
<returns>The converted float</returns>
--------------------
[<Struct>]
type float = System.Double
<summary>An abbreviation for the CLI type <see cref="T:System.Double" />.</summary>
<category>Basic Types</category>
--------------------
type float<'Measure> =
float
<summary>The type of double-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
<see cref="T:System.Double" />.</summary>
<category index="6">Basic Types with Units of Measure</category>
Union-Fall Option.Some: Value: 'T -> Option<'T>
<summary>The representation of "Value of type 'T"</summary>
<param name="Value">The input value.</param>
<returns>An option representing the value.</returns>
Union-Fall Option.None: Option<'T>
<summary>The representation of "No value"</summary>
Multiple items
val float32 : value:'T -> float32 (requires member op_Explicit)
<summary>Converts the argument to 32-bit float. This is a direct conversion for all
primitive numeric types. For strings, the input is converted using <c>Single.Parse()</c>
with InvariantCulture settings. Otherwise the operation requires an appropriate
static conversion method on the input type.</summary>
<param name="value">The input value.</param>
<returns>The converted float32</returns>
--------------------
[<Struct>]
type float32 = System.Single
<summary>An abbreviation for the CLI type <see cref="T:System.Single" />.</summary>
<category>Basic Types</category>
--------------------
type float32<'Measure> =
float32
<summary>The type of single-precision floating point numbers, annotated with a unit of measure.
The unit of measure is erased in compiled code and when values of this type
are analyzed using reflection. The type is representationally equivalent to
<see cref="T:System.Single" />.
</summary>
<category>Basic Types with Units of Measure</category>
val v : 'T (requires member IsPositiveInfinity)
[<Struct>]
type bool = System.Boolean
<summary>An abbreviation for the CLI type <see cref="T:System.Boolean" />.</summary>
<category>Basic Types</category>
val v : 'T (requires member IsNegativeInfinity)
val v : 'T (requires member IsNaN)
val formatMathValue : floatFormat:string -> _arg1:'a -> string (requires member IsNaN and member IsPositiveInfinity and member IsNegativeInfinity)
val floatFormat : string
Multiple items
val string : value:'T -> string
<summary>Converts the argument to a string using <c>ToString</c>.</summary>
<remarks>For standard integer and floating point values the and any type that implements <c>IFormattable</c><c>ToString</c> conversion uses <c>CultureInfo.InvariantCulture</c>. </remarks>
<param name="value">The input value.</param>
<returns>The converted string.</returns>
--------------------
type string = System.String
<summary>An abbreviation for the CLI type <see cref="T:System.String" />.</summary>
<category>Basic Types</category>
aktive Erkennung PositiveInfinity: 'T -> unit option
aktive Erkennung NegativeInfinity: 'T -> unit option
aktive Erkennung NaN: 'T -> unit option
aktive Erkennung Float: obj -> float option
val v : float
System.Double.ToString() : string
System.Double.ToString(format: string) : string
System.Double.ToString(provider: System.IFormatProvider) : string
System.Double.ToString(format: string, provider: System.IFormatProvider) : string
aktive Erkennung Float32: obj -> float32 option
val v : float32
System.Single.ToString() : string
System.Single.ToString(format: string) : string
System.Single.ToString(provider: System.IFormatProvider) : string
System.Single.ToString(format: string, provider: System.IFormatProvider) : string
val v : 'a (requires member IsNaN and member IsPositiveInfinity and member IsNegativeInfinity)
System.Object.ToString() : string
val formatMatrix : matrix:'a -> string
val matrix : 'a
Modul String
aus Microsoft.FSharp.Core
<summary>Functional programming operators for string processing. Further string operations
are available via the member functions on strings and other functionality in
<a href="http://msdn2.microsoft.com/en-us/library/system.string.aspx">System.String</a>
and <a href="http://msdn2.microsoft.com/library/system.text.regularexpressions.aspx">System.Text.RegularExpressions</a> types.
</summary>
<category>Strings and Text</category>
val concat : sep:string -> strings:seq<string> -> string
<summary>Returns a new string made by concatenating the given strings
with separator <c>sep</c>, that is <c>a1 + sep + ... + sep + aN</c>.</summary>
<param name="sep">The separator string to be inserted between the strings
of the input sequence.</param>
<param name="strings">The sequence of strings to be concatenated.</param>
<returns>A new string consisting of the concatenated strings separated by
the separation string.</returns>
<exception cref="T:System.ArgumentNullException">Thrown when <c>strings</c> is null.</exception>
val formatVector : vector:Vector<'T> -> string (requires default constructor and value type and 'T :> System.ValueType)
val vector : Vector<'T> (requires default constructor and value type and 'T :> System.ValueType)
Multiple items
type Vector =
static member Abs<'T (requires default constructor and value type and 'T :> ValueType)> : value: Vector<'T> -> Vector<'T>
static member Add<'T (requires default constructor and value type and 'T :> ValueType)> : left: Vector<'T> * right: Vector<'T> -> Vector<'T>
static member AndNot<'T (requires default constructor and value type and 'T :> ValueType)> : left: Vector<'T> * right: Vector<'T> -> Vector<'T>
static member AsVectorByte<'T (requires default constructor and value type and 'T :> ValueType)> : value: Vector<'T> -> Vector<byte>
static member AsVectorDouble<'T (requires default constructor and value type and 'T :> ValueType)> : value: Vector<'T> -> Vector<float>
static member AsVectorInt16<'T (requires default constructor and value type and 'T :> ValueType)> : value: Vector<'T> -> Vector<int16>
static member AsVectorInt32<'T (requires default constructor and value type and 'T :> ValueType)> : value: Vector<'T> -> Vector<int>
static member AsVectorInt64<'T (requires default constructor and value type and 'T :> ValueType)> : value: Vector<'T> -> Vector<int64>
static member AsVectorSByte<'T (requires default constructor and value type and 'T :> ValueType)> : value: Vector<'T> -> Vector<sbyte>
static member AsVectorSingle<'T (requires default constructor and value type and 'T :> ValueType)> : value: Vector<'T> -> Vector<float32>
...
<summary>Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors.</summary>
--------------------
[<Struct>]
type Vector<'T (requires default constructor and value type and 'T :> ValueType)> =
new : values: ReadOnlySpan<byte> -> unit + 5 Überladungen
member CopyTo : destination: Span<byte> -> unit + 3 Überladungen
member Equals : other: Vector<'T> -> bool + 1 Überladung
member GetHashCode : unit -> int
member ToString : unit -> string + 2 Überladungen
member TryCopyTo : destination: Span<byte> -> bool + 1 Überladung
static member op_Addition : left: Vector<'T> * right: Vector<'T> -> Vector<'T>
static member op_BitwiseAnd : left: Vector<'T> * right: Vector<'T> -> Vector<'T>
static member op_BitwiseOr : left: Vector<'T> * right: Vector<'T> -> Vector<'T>
static member op_Division : left: Vector<'T> * right: Vector<'T> -> Vector<'T>
...
<summary>Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms.</summary>
<typeparam name="T">The vector type. <c>T</c> can be any primitive numeric type.</typeparam>
--------------------
Vector ()
Vector(values: System.ReadOnlySpan<byte>) : Vector<'T>
Vector(values: System.ReadOnlySpan<'T>) : Vector<'T>
Vector(values: System.Span<'T>) : Vector<'T>
Vector(value: 'T) : Vector<'T>
Vector(values: 'T []) : Vector<'T>
Vector(values: 'T [], index: int) : Vector<'T>
Namespace Microsoft.FSharp.Data