When I create the Sumulink model (.slx) in MATLAB using the following MATLAB code, I write my data into it.

h = load_system(pathToFile); set_param(h, 'Metadata', properties)

The .slx file has a zip format, so I managed to find out that my data is being written to the .mxarray file.

enter image description here

Can you please tell me how can I extract my data from a .slx or .mxarray file using C #? Or how else can I write custom properties to the .slx file so that I can get them in the C # project?

  • The maximum you can help here is to give an example of zip unpacking. Here is ru.stackoverflow.com/a/677294/17974 an example of how to pick up a zipped stream from a word/document.xml file which is in zip. - nick_n_a
  • I had a similar option to write my xml file to zip, but the problem is that when I do this in the MATLAB code, the .slx file can be executed and accordingly there will be an error. - Oleksiy Kovalchyk
  • this is not a record. This is a docx read, which is also a zip format. You wrote how to count. Need to know which of the archives to take. Find the beginning of the archive (binary Deflate), set the DeflateStream there, tell it the Read face - and you will read the "metadata". Without details, the more specific answer will not work. Specify, show the dump signatures. Look at sample signatures in the zip dump. Ru.stackoverflow.com/a/681886/17974 - nick_n_a
  • There is another class ZipFile , if you are a beginner, then it will be easier for you through ZipFile. It does not support streams, there are examples ru.stackoverflow.com/questions/478971/… . ZipFile is on msdn. docs.microsoft.com/en-us/dotnet/standard/io/… - nick_n_a

0