Saves a PhysioExperiment object to MATLAB .mat format.
Usage
writeMAT(
x,
path,
data_var = "data",
include_metadata = TRUE,
eeglab = FALSE,
assay_name = NULL
)References
MathWorks (2024). "MAT-File Format." Technical documentation. https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html
Examples
# 'R.matlab' is an optional dependency; guard the example so it only runs
# when the package is installed.
if (requireNamespace("R.matlab", quietly = TRUE)) {
pe <- PhysioExperiment(
assays = list(raw = matrix(0, nrow = 100, ncol = 10)),
colData = S4Vectors::DataFrame(label = paste0("Ch", seq_len(10))),
samplingRate = 256
)
tf <- tempfile(fileext = ".mat")
writeMAT(pe, tf)
unlink(tf)
}