Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

extract data from hypermat and load to matlab

79 views
Skip to first unread message

Pham Thang

unread,
Oct 23, 2012, 3:23:26 PM10/23/12
to
Hi,
I have 4 dimentional hypermat in scilab. two things I want to do but I have problems.
1.I want to extract data from 1 dimension of the hypermat. for example a=A(1,1,:,3). I got a hypermat (1,1,N,1). How can I reduce the size to (1,N) or (N,1).

2. I use save command to store the hypermat in a file and I can read by load. I also want to export data to matlab but I couldnt use savematfile for hypermat. DO yo have any suggestion to save hypermat in format matlab can read?

Thanks in advances,
Thang Pham

Serge Steer

unread,
Oct 25, 2012, 8:19:19 AM10/25/12
to
Le 23/10/2012 21:23, Pham Thang a �crit :
> Hi,
> I have 4 dimentional hypermat in scilab. two things I want to do but I have problems.
> 1.I want to extract data from 1 dimension of the hypermat. for example a=A(1,1,:,3). I got a hypermat (1,1,N,1). How can I reduce the size to (1,N) or (N,1).
you can use the matrix function (similar the Matlab reshape function)
a=matrix(a,1,N)
> 2. I use save command to store the hypermat in a file and I can read by load. I also want to export data to matlab but I couldnt use savematfile for hypermat. DO yo have any suggestion to save hypermat in format matlab can read?
If A is your hypermat you can do in Scilab:
a=A.entries;
d=A.dims;
savematfile /tmp/foo.mat a d
in Matlab
load /tmp/foo.mat
A=reshape(a,d)

Serge Steer
0 new messages