matlab_save

matlab_save saves a UniScript object in a MATLAB file (mat file).

err = matlab_save(obj, ssFileName)

Return Value

err is the number 0 if no error occurred or an error object (see error_create). .. us.params

Parameters

obj

obj is a UniScript object.

ssFileName

ssFileName is the name of MATLAB file. MATLAB files normally carry the file extension .mat.

Example

def test_matlab_save()
{
    // Create an UniScript-Object
    o = [.];
    o.x = linspace(0, 2*PI, 100);
    o.y = sin(o.x);

    ssFile = GetTempPath() + "test.mat";
    err = matlab_save(o, ssFile);
    if (type(err) == "error") {
        error("Cant write " + ssFile + " (" + err.message + ")");
    }
}

test_matlab_save()

Comment

  • Data will be saved in the MATLAB format version 5.
  • Byte order is little endian.
  • The data is saved compressed.
  • Strings are saved as UNICODE (utf-8).
  • Variant matrices (e. g. v = [“text”, 123]) are not supported. They will be ignored without an error message.

History

Version Description
5.10.0 New

id-765351