From: James Tursa on
"Manjusha Venkataramani" <manjusha179(a)gmail.com> wrote in message <i0um9e$5ti$1(a)fred.mathworks.com>...
> "
> > Please be more specific. Which exact file are you using? Is it short enough to post? How are you including the mat.h file? What compile commands are you using?
> >
> > James Tursa
>
> Hey
>
> I am actually working on speaker verification . I extracted features in matlab which r mat files and i need those values in that matrix to be read by c++ . LETS SAY I NEED TO OPEN the matrix and read its contents and do various operations on it in C++.
>
> i included the mat.h file by using the command gksudo nautilus . I became the superuser and copied the mat.h into the folder of libraries which had stdio.h and other std libraries

You aren't giving me much to help you with. If I want to read a mat file in C/C++ then I just use matOpen and matGetVariable with #include "mat.h" in the file. I compile with the mex command. I *don't* copy the mat.h file from anywhere to anywhere. Works fine.

James Tursa
From: Rune Allnor on
On 6 Jul, 10:33, "James Tursa"
<aclassyguy_with_a_k_not_...(a)hotmail.com> wrote:

> If I want to read a mat file in C/C++ then I just use matOpen and matGetVariable with #include "mat.h" in the file. I compile with the mex command. I *don't* copy the mat.h file from anywhere to anywhere.  Works fine.

It does. However, using the mex command only works if you call
the functions from inside a C++ mex file. The OP needs to clarify
if this is what he does, or if he, as I interpret his post,
wants to open the .mat file in a C++ program independent from
matlab.

Rune
From: Manjusha Venkataramani on
@James Tursa : I will read on mex command . The gcc library header files do not have mat.h as a part of their library .

I open a wav file m read its contents , extract some spectral information from it and store it as 1.mat . Now i close my matlab . I open a c++ File and i want it to read my contents of the mat , every row and every column and perform some functions on each row and column .
Did i make myself clear now ??

@Rune Allnor : I am a girl and not a he . Yes i am only a beginner in matlab and C++ . I am a student and i am trying to learn . If you dont want to share your professional knowledge , please dont . But dont be so rude to me and demotivate me like this saying learn to run your computer . If i have done some mistake , please point the mistake out . I am ready to learn .
From: Rune Allnor on
On 6 Jul, 12:42, "Manjusha Venkataramani" <manjusha...(a)gmail.com>
wrote:
> @James Tursa : I will read on mex command . The gcc library header files do not have mat.h as a part of their library .
>
> I open a wav file m read its contents , extract some spectral information from it and store it as 1.mat . Now i close my matlab . I open a c++ File and i want it to read my contents of the mat , every row and every column and perform some functions on each row and column .
> Did i make myself clear now ??
>
> @Rune Allnor : I am a girl and not a he .

Sorry for making the wrong assumption.

> Yes i am only a beginner  in matlab and C++ . I am a student and i am trying to learn . If you dont want to share your professional knowledge , please dont . But dont be so rude to me and demotivate me like this saying learn to run your computer . If i have done some mistake , please point the mistake out . I am ready to learn .  

First of all: I am not rude, I am pointing out facts.

1) You make some very basic mistakes about C++, that
demonstrates beyound any shadow of a doubt that you
are a beginner.

So you need to learn basic C++.

2) You say you switch to 'superuser' and do certain stuff
that don't make much sense. The stuff you do demonstrates
beyond doubt that you are a beginner. Doing the stuff
as superuser is a catastrophe waiting to happen.

Find out the difference between a 'superuser' and a
'[regular] user' on a Linux system.

If you really are willing to learn, sthart with those two
issues first. Once you understand how C++ works and how to
use it on your particular system, come back and ask.

You may or may not like to have this told to you as bluntly
as I have done, but that's the situation you are in, and
that's what you need to do to get any further.

Rune
From: Steven Lord on

"Manjusha Venkataramani" <manjusha179(a)gmail.com> wrote in message
news:i0ugdv$i7f$1(a)fred.mathworks.com...
> hey people
> I use a Linux for my gcc programming . When i sue the file given on this
> website for reading a mat file on to c++ , it says no mat.h header file
> exists . Nd if i copy the mat.h available in matlab to my gcc library , it
> generates errors. Could anybody please help me ??

I recommend that you read through the example given in the first chapter of
the External Interfaces manual that is part of the main MATLAB
documentation. If you open the documentation using the command "doc" and
navigate to MATLAB -> User Guide -> External Interfaces -> Importing and
Exporting MAT-Files from C/C++ and Fortran Programs, one of the sections of
that chapter includes examples of how to manipulate MAT-files in C, C++, and
Fortran.

As for the mat.h header file, that is part of MATLAB and should be in the
matlabroot\extern\include directory, where matlabroot is the root directory
of your MATLAB installation. You will need to include that header file to
use the MAT-file manipulation routines.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com