===== Export_Data_To_Matfile ===== ====Overview==== Data can be exported from Visual 3D to a MAT file by using the **Export_Data_To_Matfile** command. This command allows you to save signal data and parameter data from Visual 3D into MAT format so it can be read by a Matlab function. You must specify the file name of the file from which the data is to be taken, the signal name, the signal type, whether or not the signal is processed or not, and the output name. The output name is simply the name of the variable that is saved in the MAT file; this is not necessarily the same as the signal name (see below). In addition to this, if you want to export parameters (data from the PARAMETERS branch of the data tree), you can include the **PARAMETER_GROUPS, PARAMETER_NAMES, and OUTPUT_PARAMETER_NAME.** This command is similar to [[visual3d:documentation:pipeline:file_commands:export_data_to_matlab|Export_Data_To_Matlab]] except that the resulting data is placed in an Matlab .mat file rather than being pushed into the Matlab Workspace. It is very important to note that Visual3D expresses an unknown value (e.g. a TARGET with residual of -1) using the value DATA_NOT_FOUND (-99999). Matlab doesn't recognize this Visual3D expression, so you may want to replace DATA_NOT_FOUND with NaN (e.g. /USE_NAN_FOR_DATANOTFOUND=TRUE). If you don't and you list the contents of the variable in Matlab, your data may be scaled to 1.e5, which means that most of your values may end up looking as if they were zero. If you enter DATA_NOT_FOUND, you can have your m-file search for this value, so that you can continue to perform matrix math in Matlab (which won't process NaN in an array). Text version below: ====Pipeline Command==== Export_Data_To_Matfile ! /SIGNAL_TYPES= ! /SIGNAL_FOLDER= ! /SIGNAL_NAMES= ! /FILE_NAME= /MATLAB_NAMES= ! /PARAMETER_NAMES= ! /PARAMETER_GROUPS= ! /OUTPUT_PARAMETER_NAMES= ! /USE_NAN_FOR_DATANOTFOUND=FALSE ; ====Dialog==== {{:export_data_to_matfile.png?600}} ===Example=== As an example, Visual3D will export data to Matlab (.mat) files using the following pipeline command syntax. This example was derived using the ExampleWalk.c3d file available on the website. Export_Data_To_Matfile /FILE_NAME=c:demo filesMatlabtestmat.mat /SIGNAL_TYPES=TARGET+TARGET+TARGET+ANALOG+ANALOG /SIGNAL_NAMES=RFT1+RFT2+RFT3+FZ2+EMG9 /SIGNAL_FOLDER=ORIGINAL+ORIGINAL+ORIGINAL+ORIGINAL+ORIGINAL /OUTPUT_NAMES=RFT1+RFT2+RFT3+FZ2+EMG9 ! /PARAMETER_NAMES= ! /PARAMETER_GROUPS= ! /OUTPUT_PARAMETER_NAMES= ; Note that Matlab 7.0 Release 14 is incompatible with Release 12 and 13; Visual3D currently import/exports data for release 12 and 13.//