Menu

"test_write_sparse" on ver 4 making invalid files

Help
daractive
2019-10-11
2019-10-13
  • daractive

    daractive - 2019-10-11

    Basically if I run "test_write_sparse" with all data types supported by version 4 Matlab files (as taken from "Mat_VarWrite4"), only the file for the "double" type seems to work. All other types produce files that Matlab claims to be corrupted and Octave informs that "subscripts must be either integers 1 to (2^63)-1 or logicals". Said error message suggests some error while writing indexes for the array but I can't find connection between data type and said indexes.
    Attached is a file for a "single" data type.

     
  • tbeu

    tbeu - 2019-10-11

    It seems you built matio with --enable-extended-sparse=yes (which is the default and the expected behaviour). Try building with --disable-extended-sparse and you won't be able to create sparse MAT files that MATLAB cannot read.

     
  • daractive

    daractive - 2019-10-11

    Thanks for response.
    Is there any particular reason why it acts like this? I'm mostly interested in knowing why, despite the code looking logical (and the option being there in the first place), it doesn't work. Other write tests seem to handle those data types smoothly.

     
  • tbeu

    tbeu - 2019-10-13

    Copied from https://github.com/tbeu/matio#222-configure-options

    --enable-extended-sparse=yes Enable extended sparse matrix data types not supported in MATLAB. MATLAB only supports double-precision sparse data. With this flag, matio will read sparse data with other types (i.e. single-precision and integer types).

     
    • daractive

      daractive - 2019-10-13

      Yea, that would explain it.
      Thank you very much.

       

Log in to post a comment.