mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

MatlabWriter does not write into Memorystrem

Open christoph33 opened this issue 8 years ago • 2 comments

FileStream works, but MemoryStream is Null.

        Matrix<double> m1 = Matrix<double>.Build.Random(3, 4);
        Matrix<double> m2 = Matrix<double>.Build.Random(3, 4);

        MemoryStream mem = new MemoryStream();

        // write a dictionary of matrices:
        var dict = new Dictionary<string, Matrix<double>>();
        dict.Add("m1", m1);
        dict.Add("m2", m2);
        MatlabWriter.Write( mem, dict);

christoph33 avatar Oct 20 '17 07:10 christoph33

...downloaded the sourcecode and noticed, the stream is been flushed to disk and then been closed in a subroutine. I can change that, but it would not be as elegant (quick and dirty) as the rest of the code.

Background is to write matrices to the clipboard and the load it into matlab without doing any filesearch.

christoph33 avatar Oct 22 '17 13:10 christoph33

wrong button...

christoph33 avatar Oct 22 '17 13:10 christoph33