Menu

Error when reading int8

2016-01-06
2016-01-08
  • Martin Høy

    Martin Høy - 2016-01-06

    Hi,

    I'm trying to read a file that contains a variable which is int8. I get the following error message:

    System.InvalidCastException: Unable to cast object of type 'csmatio.types.MLInt8' to type 'csmatio.types.MLNumericArray`1[System.Byte]'
    at csmatio.io.MatFileReader.ReadMatrix(Stream buf, Boolean isRoot)
    at csmatio.io.MatFileReader.ReadData(Stream buf)
    at csmatio.io.MatFileReader.ReadData(Stream buf)
    at csmatio.io.MatFileReader..ctor(String fileName, MatFileFilter filter)
    at csmatio.io.MatFileReader..ctor(String fileName)

    The file that causes the error can be downloaded from here:
    https://dl.dropboxusercontent.com/u/675216/HZV-24-7077-BCH.mat

    Regards,

    Martin

     
    • Tobias

      Tobias - 2016-01-06

      Which revision are you using? I hoped that at least all the integer stuff would work since revision 12.

       
  • Tobias

    Tobias - 2016-01-06

    Reading your file with the r13 demo application and csmatio.dll I can see no errors:

    Attempting to read the file 'D:\dev\repos\csmatio\test-tobias\HZV-24-7077-BCH.mat'...Done!
    MAT-file contains the following:
    [descriptive text: MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Tue Apr 14 10:27:54 2015                                        , version: 0x0001, endianIndicator: IM]
    T = 
    [1344x1  double array]
    V = 
    [1344x1  int8 array]
    Q = 
    [1344x1  uint32 array]
    

    (Tested with Windows 7/64 and Visual Studio 2013)

     
  • Martin Høy

    Martin Høy - 2016-01-08

    Thanks!

    It's working now. We were obviously using some old version before the r12-fix.
    I compiled r13, and thought that I tested with it too, but I forgot to place the new .dll in the right directory...

    Regards,

    Martin

     

Log in to post a comment.