The command converts MATLAB files (.mat) into UniPlot-netCDF files or netCDF files into MATLAB files. A MATLAB installation is not necessary.
MATLAB is a trademark of The MathWorks, Inc. (http://www.mathworks.de).
MATLAB files in the ControlDesk format can be loaded. ControlDesk is a trademark of dSpace GmbH. (http://www.dspace.de).
The following MATLAB file elements are loaded:
A MATLAB vector is saved as a channel in the NC file. The element name is used as the channel name. The vector must contain at least 2 values.
Each column of a MATLAB matrix is saved as a channel. The matrix can be imported, if the following conditions are met:
The names of the first row are used as channel names. If the string matrix contains more than one row, the second row is used as units. All other rows are ignored.
Example of a valid structure for a matrix with 3 columns and 2 rows:
* o = [. Data = rand(2,3), Header = ["C1", "C2", "C3"]]
* o
[.
Data = matrix 2 x 3 [0.566211, 0.82072, 0.325495, 0.34008, 0.895177, ...]
Header = string-matrix 1 x 3 ["C1", ...]
]
object (obj at 0x386C4BC)
*
The following elements are used for the import if available:
channel_info: Is an array of structures. The structure name should match a channel name. Each structure element is saved as a channel attribute. Predefined elements: C_format, add_offset, datatype, long_name, scale_factor, title, units.
globals: Contains scalar elements which are saved as global attributes in the NC file.
order: Is a string array with channel names which sets the order in the NC file.
Example:
* matlab_load(GetRootDirectory() + "samples/map-data.mat")
[.
BEEWG = matrix 1 x 78 [1002.5, 461.7, 350.3, 322, 302.6, ...]
CO = matrix 1 x 78 [0.6, 0.08, 0, 0.05, 0.05, ...]
order = string-matrix 2 x 1 ["BEEWG", "CO", ...]
channel_info = [.
BEEWG = [.
C_format = "%.2lf"
add_offset = 0
datatype = "real4"
long_name = "BEEWG/g/kWh"
scale_factor = 1
title = "BEEWG"
units = "g/kWh"
]
CO = [.
C_format = "%.2lf"
add_offset = 0
datatype = "real4"
long_name = "CO/%"
scale_factor = 1
title = "CO"
units = "%"
]
]
globals = [.
Creator = "UniPlot Excel Converter v2"
Origin = "D:\uniplot_du\samples\map-data.xls [map]"
Source = "Uniplot Software GmbH (www.uniplot.de)"
missing_value = 1e+10
]
]
A netCDF file can be saved as a MATLAB file. See File=>Export Data.
id-1736791