R.matlab icon indicating copy to clipboard operation
R.matlab copied to clipboard

Problem with 3D array [when using writeMat()]

Open PMassicotte opened this issue 9 years ago • 0 comments

Hi there.

I'm trying to export a structure (i.e. list) from R to a .mat file. Lets look at the following code.

C <- array(rnorm(18), dim=c(2,3,3))

# This works
filename <- paste(tempfile(), ".mat", sep="")
R.matlab::writeMat(filename, C = C)

# This does not work, we loose dimension
struct = list(C = C)
R.matlab::writeMat(filename, struct = struct)

Is there any easy fix to that?

Cheers,

Philippe

PMassicotte avatar Oct 29 '15 10:10 PMassicotte