0

I have some matlab data files, extension .mat

I want to know if it is possible to read the data in the mat file and then output this data to an excel spreadsheet using VBA, so with code written in the excel workbook or using C#

I have seen you can convert mat files to xls files however I do not wish to do this. I was hoping you could read the .mat file in the code and then select the data you wish to output to the excel spreadsheet

mHelpMe
  • 6,336
  • 24
  • 75
  • 150
  • 1
    Possible duplicate of [Import / read / load variables from matlab matfile in C#](http://stackoverflow.com/questions/4281348/import-read-load-variables-from-matlab-matfile-in-c-sharp) – Micke May 05 '16 at 09:56
  • Do you have to use .mat files? What about something more universal like JSON? – Dan May 05 '16 at 10:22
  • sadly i do have to use mat files – mHelpMe May 05 '16 at 10:23
  • 1
    In addition to the above link, the newer Matlab file format is a variant of Hierarchical Data Format (HDF5) which has .NET libraries here: http://hdf5.net/ – Hugh Nolan May 05 '16 at 11:19

1 Answers1

-1

You want to import the code from a .m file? Yeah, you can do that. Just import the data, which is simply stings of code.

Data > From Text > Import

ASH
  • 20,759
  • 19
  • 87
  • 200
  • The OP is asking about .mat files, which is different from the text-based .m files your answer addresses. – Setsu May 11 '16 at 20:59