mahalex / MatFileHandler

MATLAB .mat-file reading/writing API for .NET Standard
MIT License
40 stars 12 forks source link

Can MatLabReader use a URL as the file location of the .mat file? #9

Closed patrickmcdermo closed 5 years ago

patrickmcdermo commented 5 years ago

I have the following code, which works fine: String filePath = "C:\MyFolder\MyMatFile.mat"; Matrix m = MatlabReader.Read(filePath);

However when I change filePath to a URL, I get the following error: String filePath = "https://myproj.blob.core.windows.net/mycontainer/MyMatFile.mat"; Matrix m = MatlabReader.Read(filePath);

Error: System.NotSupportedException: The given path's format is not supported.

Here's my code:

using System; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.Data.Matlab;

namespace TestMatlabAzure { class Program { // this one works private const string filePath = "C:\Data\ImportFiles\CMI\Test_20190615\probFile_nn07c_20180316_000000_0.mat";

// this one doesn't
//private const string filePath = "https://elpround3.blob.core.windows.net/test0705/probFile_nn07c_20180316_000000_0.mat";

static void Main(string[] args)
{
    Console.WriteLine("Reading .mat file....");
    Matrix<double> m = MatlabReader.Read<double>(filePath);
    Console.WriteLine(m.ToString());
    Console.ReadKey();
}

}

mahalex commented 5 years ago

This is not related to MatFileHandler; you should ask MathNet.Numerics developers.