Re: [R] Saving a 3d array into a matlab file

From: Henrik Bengtsson <hb_at_stat.berkeley.edu>
Date: Sat, 01 Nov 2008 13:17:23 -0700

Hi, a follow up on this: I've fixed the below bug in writeMat(). R.matlab v1.2.4 is now available on CRAN. Please update.

Henrik

On Tue, Oct 28, 2008 at 3:30 PM, Henrik Bengtsson <hb_at_stat.berkeley.edu> wrote:
> Hi,
>
> On Tue, Oct 28, 2008 at 2:25 PM, Minho Chae <minho.chae@gmail.com> wrote:
>> Dear R users,
>>
>> I am tryting to save an 3d array to a matlab file like the following.
>>
>> A <- array(1:24, c(2,3,4))
>> writeMat(filename, A=A)
>>
>> But if I load the mat file from Matlab, it is not 3d matrix anymore.
>> Does anyone know how I can preserve the 3d structure?
>> Any help will be greatly appreciated.
>
> This is a bug that I'll have to look into. The dimension seems to get
> lost. I'll also have to fix an earlier problem with writeMat()
> existing in R.matlab v1.2.2 and later. See archive how to install the
> latest stable version v1.2.1. In the meanwhile you can do something
> like:
>
> writeMat(filename, list(A=A, dim=dim(A)))
>
> and reassign the dimension manually in Matlab (I don't know how that's
> done though).
>
> FYI, readMat() is way more stable/tested than writeMat(). The only
> redundancy tests I can do on writeMat() is to try to read the data
> back in using readMat(). I have little time to load writeMat()
> written *.MAT files in Matlab.
>
> /Henrik
>
>>
>> Minho Chae
>>
>> [[alternative HTML version deleted]]
>>
>> ______________________________________________
>> R-help_at_r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sat 01 Nov 2008 - 20:22:27 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 01 Nov 2008 - 20:30:21 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive