Creating Matrix from CSV

(Roger Garshol) #1

I’m trying to create a matrix and populating this new data structure with values i’ve stored in a CSV file but I keep running into problems.

My latest attempt is giving me a long error message in VS, see the code line below. The last line shows the error message i get in Visual Studio

Is there any one that can point me in the right direction on to initiate a matrix from a CSV file or know of sites which has examples of using Mathnet with

Dim matrix As MathNet.Numerics.LinearAlgebra.Matrix(Of Double) =MathNet.Numerics.Data.Text.DelimitedReader.Read(GMatrixFile, False, “;”, False)

Error 3 Overload resolution failed because no accessible ‘Read’ can be called with these arguments:

(Christoph Rüegg) #2

Sounds like a versioning issue to me. Which versions are you using of the MathNet.Numerics and the MathNet.Numerics.Data.Text packages? What is your traget platform/framework (e.g. .Net 4.5)?

(Roger Garshol) #3

Hi Christoph
I’m using MathNet.Numerics.Data.Text 3.2.0 and MathNet.Numerics 3.13.1 and my target platform is .net v4 (4.0.30319)


(Christoph Rüegg) #4

The error message was quite confusing to me, as I am not fluent in VB.Net. It turns out the problem is that the generic type parameter must be explicitly specified. Try specifying the type explicitly:

DelimitedReader.Read(Of Double)(GMatrixFile, delimiter:=";")

(Roger Garshol) #5

That solved it.
Thank you :slight_smile: