[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
If you still want to import a mat file from C++ then that is not an
Eigen-specific topic, you may have to find a library that can deal with
..mat file importing,
or write your own.
Cheers.
------------------------------------------
Carlos
On Wed, Jun 27, 2012 at 12:02 PM, Gaurav Gupta <gaurav71531@xxxxxxxxx>wrote:
> Hello,
>
> How can I import data from matlab ".mat" file. My data is complex valued
> matrices.
> Thanks
>
> Gaurav
>
--20cf303e9f20f1dde704c3715d35
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Hi. It may be easier to write a mex file instead, and call that mex file fr=
om matlab. This is what I usually do with my code.<div><br><div>You can map=
the data from a matlab matrix (real or complex) with Eigen::Map<>. A=
s far as I remember, Matlab buffers are already aligned,</div>
<div>so you can use Eigen::Aligned and RowMajor as well.</div><div><br></di=
v><div>From there you can do whatever you want with Eigen, and return resul=
ts to =A0matlab.=A0</div><div><br></div><div>If you still want to import a =
mat file from C++ then that is not an Eigen-specific topic, you may have to=
find a library that can deal with .mat file importing,</div>
<div>or write your own.</div><div><br></div><div>Cheers.</div><div><br></di=
v><div><div><font color=3D"#888888" face=3D"arial, sans-serif"><span style=
=3D"border-collapse:collapse">------------------------------------------</s=
pan></font></div>
<div><font color=3D"#888888" face=3D"arial, sans-serif"><span style=3D"bord=
er-collapse:collapse">Carlos</span></font><font color=3D"#888888" face=3D"a=
rial, sans-serif"><br></font><font color=3D"#888888" face=3D"arial, sans-se=
rif"><span style=3D"border-collapse:collapse"></span></font></div>
<br>
<br><br><div class=3D"gmail_quote">On Wed, Jun 27, 2012 at 12:02 PM, Gaurav=
Gupta <span dir=3D"ltr"><<a href=3D"mailto:gaurav71531@xxxxxxxxx" targe=
t=3D"_blank">gaurav71531@xxxxxxxxx</a>></span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex">
Hello,=A0<div><br></div><div>How can I import data from matlab ".mat&q=
uot; file. My data is complex valued matrices.</div><div>Thanks</div><span =
class=3D"HOEnZb"><font color=3D"#888888"><div><br></div><div>Gaurav</div>
</font></span></blockquote></div><br></div></div>
--20cf303e9f20f1dde704c3715d35--