Hi @Yoni Stern
The most reliable approach is to use MATLAB's official .NET interface. This requires having MATLAB installed on the machine where your C# code runs. Here's an example script to achieve your task-
using MathWorks.MATLAB.NET.Arrays;
using MathWorks.MATLAB.NET.Utility;
// Create your 3D array
double[,,] myArray = new double[10, 20, 30]; // Your actual data here
// Convert to MATLAB array
MWNumericArray matlabArray = new MWNumericArray(myArray);
// Save to .mat file
MATLAB.save("C:\\path\\to\\your\\file.mat", "variableName", matlabArray);
You can find more information about this approach in the official documentation for MATLAB Engine API for .NET - https://www.mathworks.com/help/compiler_sdk/dotnet_assemblies.html
