Shehzad K. answered 02/17/23
Unlocking Potential: Unleashing the Genius Within You
To write custom properties to a .slx file in C#, you can use the MATLAB API for .NET. Here's an example
MLApp.MLApp matlab = new MLApp.MLApp();
// Load the .slx file
matlab.Execute("model = load_system('path/to/your/file.slx');");
// Set the custom properties here you can use loops also
matlab.Execute("set_param('model', 'CustomProperty1', '123');");
matlab.Execute("set_param('model', 'CustomProperty2', 'hello');");
// Save the modified model back to the .slx file
matlab.Execute("save_system('model', 'path/to/your/file.slx');");
Hope you will get answer to the question