Create MDF-file with metadata
mdfCreate( creates an MDF-file at
the location specified by
mdfFileName, using default file metadata. The
file name must include the extension
mdfFileName can specify an absolute or full
path, or a URL for a file on a remote server.
creates an MDF-file using the specified metadata to configure during file creation. The
mdfInfoObj must be of the form returned by the
which you can use to create the object and then modify it as needed. The supported values
mdfInfoObj.Version property are
creates an MDF-file and returns its full path name as a string to the variable
newMDFFile = mdfCreate(___)
newMDFFile. The returned full path can be useful when specifying a
partial or relative path to create the file.
Create an MDF-File with Default Metadata
Create a new MDF-file, and view its metadata.
ans = "C:\data\mdf\MDF_25Dec.mf4"
ans = MDFInfo with properties: File Details Name: "MDF_25Dec.mf4" Path: "C:\data\mdf\MDF_25Dec.mf4" Author: "" Department: "" Project: "" Subject: "" Comment: "" Version: "4.20" InitialTimestamp: 2022-10-20 18:39:41.000000000 Creator Details ProgramIdentifier: "MATLAB" CreatorVendorName: "The MathWorks, Inc." CreatorToolName: "MATLAB" CreatorToolVersion: "126.96.36.1991372 (R2023a)" CreatorUserName: "" CreatorComment: "" File Contents Attachment: [0×8 table] ChannelGroupCount: 0
Create an MDF-File with Custom Metadata
Create a new MDF-file with modified metadata.
Create a default information object, set its properties, and make a new MDF-file.
minfo = mdfInfo; minfo.Comment = "25-Dec Shift B."; minfo.Version = "4.10"; % ⋮ % Modify other properites as needed. % ⋮ mdfCreate("MyMDFfile.mf4",FileInfo=minfo);
Create a new MDF-file with metadata taken from an existing file.
minfo = mdfInfo("MyMDFfile1.mf4"); % Existing MDF-file. info.Version = "4.10"; createdFilePath = mdfCreate("MyMDFfile2.mf4", FileInfo=info) % New file, with matadata from existing file.
mdfFileName — MDF-file name
string | char
MDF-file name to create, specified as a string or character vector. The file name
can be a relative or absolute path. The name must include the extension
Depending on the location you are accessing,
mdfFileName can take one of these forms.
|Current folder or MATLAB® path|
To access a file in the current folder or MATLAB path, specify the
name of the file in
To access a file in a folder other than the current folder, specify
the full or relative path name in
To access a file in a remote location,
Based on the remote location,
For more information, see Work with Remote Data.
newMDFFile — Name of newly created MDF-file
Full path name of the newly created MDF-file, returned as a string.
Version HistoryIntroduced in R2022a
R2023a: mdfCreate Accepts Object Argument
In previous releases,
mdfCreate accepted a structure input
argument. Starting in R2023a, the input argument is an
This update is consistent with the update to the
mdfInfo function, which creates an object you can use as input to
mdfCreate. Where possible, the properties of this object reflect the
field names of the old structure, so programmatic access might be unchanged.
R2023a: Support for Remote File URLs
You can directly access MDF-file data stored at remote locations, including Amazon S3, Azure® Blob Storage, and HDFS.