Re: [R] importing multidimensional matrix from MATLAB

From: Phil Spector <spector_at_stat.berkeley.edu>
Date: Thu, 10 Jun 2010 01:31:44 -0700 (PDT)

Gopi -

    Not much to go by, but maybe this will be helpful:

In matlab:

>> themat = rand(10,5,3)
>> save themat

In R:

> library(R.matlab)
> themat = readMat('themat.mat')
> dim(themat$themat)

[1] 10 5 3

(Since .mat file can store more than one object, readMat returns a list with each object as a named element.)

On Thu, 10 Jun 2010, Gopikrishna Deshpande wrote:

> Hi,
>
> Suppose I have a matrix of size 256x14x32 in MATLAB. I want to import
> that into R. I used readMat and then do.call. But the variable is
> stored as an array as its done in R. However, I want to define a
> variable W=array(0,c(256,14,32)) in R and read the multidimensional
> matlab variable into W. I am not able to do this in R. Please, could
> you help ?
>
> Thanks
> Gopi
>
> [[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 Thu 10 Jun 2010 - 08:35:44 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 Thu 10 Jun 2010 - 08:50:28 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