How to debug (step run) a mex file(mexw32 or dll file) in MSVC / visual studio 2008 express edition
Please follow following steps
0.Creat your dll or mexw32 file using the option make -g or mex -g
1.Close every thing(to make it fast .. not mandatory though
2.Open MSVC 2008 Express Edition
4.From MS VC 2008 Go To Tools->Attach To Process (If this option does
n't show up repeat step 1 and it will :)
5.In Attach to process, select MATLAB.exe (Native code option is
selected by default. If it is not select it manually)
6.From VC IDE, go to File->Open->File and select the file having
mexFunction(testmex.c in my case)
7.Put Breakpoints ar required lines(it w...Segmentation violation in mex file. How can we debug a mex file? I do not have unix.
Here is the mex code I wrote to read in a tab-delimited file. The mex file =
got created but it causes my MATLAB to end abruptly and give the following =
error. Can anyone help me where I am going wrong? Please let me know if any=
further information is required
Abnormal termination: Segmentation violation
void mexFunction(int nlhs,mxArray *plhs,int nrhs,const mxArray *prhs)
const char **field_names; ...Debug MATLAB Mex files using Eclipse
I am debugging MATLAB Mex files on Mac OS X. I am used to debugging them using VC++ on Windows. However, I am not very good with debugging using GDB. So I was wondering if there was any way of debugging MATLAB mex files on Mac using Eclipse C/C++ IDE.
...Debug C MEX source file in Matlab?
Can I debug C MEX source file directly in Matlab editor?
> Hi all,
> Can I debug C MEX source file directly in Matlab editor?
> Best regards,
short answer: you can't.
long answer: you can start matlab by telling it what debugger to use (if
you are on windows, from your ide, or in linux e.g. gdb). it then
starts in the debugger. you can then set a breakpoint in your mex file
and debug it as usual. however: it is a hassle, and i never got it
really work on linux (the thing always crashed horribly). but you ...How to debug matlab MEX-file using lcc-win32 debugger
Hi! I have written a matlab MEX file using C under Win XP. Now I want
to debug it. I'd like to know if there's any way that I could debug it
in lcc-win32? Now i only know the meathod to debug it in VC.
Thank you very much!
> Hi! I have written a matlab MEX file using C under Win XP. Now I want
> to debug it. I'd like to know if there's any way that I could debug it
> in lcc-win32? Now i only know the meathod to debug it in VC.
> Thank you very much!
Mathlab refuses to pay any maintenance for the compiler version
they are using. I do not...debugging mex files with solaris 8 and matlab 6.1
Does somebody know if latest versions allow mex files' debugging with dbmex?
I've read on the help that sun solaris and matlab 6.1 are incompatible on
Starting matlab with -Ddebugger or -Ddbx doesn't work...
when I digit "run" I receive a SEGV...
someone could help me?
Thank you in advance,
"I poeti sono come i bambini: quando siedono a una scrivania non toccano
terra coi piedi" Stanislaw Lec
...old MEX files Matlab 2008 and Ubuntu 8.10
I'm facing the problem to get compiled an old MEX wrapper function that should interface Matlab with some C code.
Such wrapper was done for Matlab 6 and works for Matlab 7 but now when I try to compile it with the Matlab 2008a I got some weird problems.
If I use the command:
mex ./src/myCfile.c -v -L ./bin
Matlab will complain with:
cmat.o: In function `checkstr':
cmat.c:(.text+0x81): undefined reference to `mxGetString_700'
cmat.o: In function `setDisparity':
cmat.c:(.text+0xe1): undefined reference to `mxGetNumberOfDimensions_700'
cmat.o: In function `setIma...Must of -vs- Must've -vs- Must have
Just between you and I, you peeps can argue about these, too.
at firstname.lastname@example.org wrote on 1/21/09 7:26 PM:
> Just between you and I, you peeps can argue about these, too.
> --- Joe
Just between you and me, your grammar is poor.
iMac (24", 2.8 GHz Intel Core 2 Duo, 2GB RAM, 320 GB HDD) � OS X (10.5.4)
In article <C59D438D.2F27F%nicknaym@[remove_this].gmail.com>, Nick Naym
> In article
> none-2101091626110001@di...[mex] how debug a mex file with visual studio
I want to understand how to debug a mexfile with visualstudio.
I made some research and I found a topic which explain how to do it.
I followed all the step,
I compiled the ".c" with debug option : mex _g
I attached the matlab process on visual studio
then I run the file on matlab.
the file work, i have the result on matlab, but it doesnt stop on the breakpoint putted on the file with visual studio. I am not able to get in the code.
I don t understand why.
someone got an idea?
Bonjour a to...size of Matlab files vs. SAS files
I have about a million observations that I want to save into a
dataset. Would the file be smaller if I saved it in Matlab or in
SAS? For approximately 20 columns, how big would it be? Thanks for
any help you can provide.
Christine J wrote:
> I have about a million observations that I want to save into a
> dataset. Would the file be smaller if I saved it in Matlab or in
> SAS? For approximately 20 columns, how big would it be? Thanks for
> any help you can provide.
Depends on how you do the save operation. If you write it as a binary
file, it will be (number_elements * elem...How do I debug a MATLAB 7.1 (R14SP3) MEX-file in Microsoft Visual Studio 6.0?
I followed the instrutions on
to debug my mex file in Microsoft Visual ++ 6.0 .
After set the correct project setting in the new visual project and clicking on run in visual Matlab opens. However, I get the following error messages in Visual and if I call the mex function from Matlab it does not stop at the breakpoint that I have set in Visual. It just runs over it.
Loaded symbols for 'C:\UserData\algomodel\Matlab\VE_MexKernel.mexw32'
Loaded 'C:\Program Files\MATLAB\75_EL\...Forcing Matlab to run .m file when a mex file is present
I am creating an environment to test mex files which will replace
exisiting m files in an extensive matlab simulation. As I do this I
want to be able to check that the results from the new mex function
are the same as the result from the existing m file function. Is
there a slick way to force Matlab to call the m file function when a
mex function of the same name exists? Ideally I would want to do
a = my_function(x,y,z) % calls the mex version
b = my_function(x,y,z) % calls the m file version
error = abs(a-b);
Any suggestions that don't require renaming files?
Thanks a l...Differences in XML File generated in Matlab vs Outside Matlab
I have a java class, which generates the XML file. I am using the same class in both Matlab session and in Eclipse.
Following is the code I am using to genate the XML file
public static void saveDocument(Document doc, File file) throws Exception
DOMSource source = new DOMSource(doc);
OutputStream stream = new FileOutputStream(file);
StreamResult result = new StreamResult(stream);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOu...How to call or pass MATLAB file pointer in C Mex file?
1. I am trying to read large binary data files (~1 GB size), process the information and dump the outputs (which are also of incredibly big size) to MATLAB workspace. I wrote a mex file to do the same (so that I have faster program execution speeds).
2. The C mex file that I wrote works very well and can dump all the variables to MATLAB workspace for smaller size files. However for larger binary files, the MATLAB gives OUT OF MEMORY error as the size of the variable space is simply too big.
3. Often I am not interested in all portions of the file and don't need all the variab...how to debug mexed c-file without corresponding m-file?
I downlaod some mex-ed c-files and want to make modification for my problem. However, I don't have the origianl corresponding m-files.
So the debugging method introduced in matlab help document doesn't work and can't transfer the data and debugging progress to MS Visual C 2005.
Is there any method that can achieve the debugging without original m-files?
Thanks a lot!
...MATLAB crashing with MEX file in function working well outside of MATLAB
I have an high level problem (I believe) that I will try to explain;
My development platform is:
64bit Ubuntu 12.04 LTS and MATLAB 2013b with GCC/G++-4.7 library
I am trying to create a MATLAB interface by coding a MexFunction using gigantic C++ library previously developed.
For the tests I previously build and MexFunction only using and parsing XML files as inputs where paths are hardly defined within the function (for simplification and debugging), and I am not passing any input and output with *plhs and *prhs yet. My code includes MexFunction can be compiled with...MATLAB.App File Type (to compile mex-files with Codewarrior on MacOSX) ?
I am trying to compile a project (to have a mex-file at the end) with
Codewarrior9 and Matlab7 (on a Mac). It works fine with Matlab5 and
Codewarrior8, but not now.
One of my problem is that Matlab5 was put in the project (I don't
know how, it's not my project). Now I want to swap to Matlab7, but
when I want to add it, Matlab7 appears as a directory (not in the Mac
Finder though). The moderator of CW adviced me to check the extension
of Matlab7 and add it to the mapping files settings of my project.
However, I have no idea of what Matlab's File Type is.
Also, CW asks me for ...debugging mex files
I have programmed a complex MEX file in C, using
VC++ 7.0 as my compiler. I am now searching for
an optimal way to debug this MEX file using VC++ 7.0
preferably but the corresponding MATLAB documentation
applies to Microsoft compiler versions 5/6. The listed commands do
not even apply. Any help would be greatly appreciated, slp.
...debug MEX file
Forgive me for the basic question, I really want to know how to debug
a MEX file,
use LCC as complier,
>> mex mycalc.c
May someone can help that if i want to stop the program in some line
and check value of local variables ??
Thank you all!!
"Steven Zhang =D0=B4=B5=C0=A3=BA
> Forgive me for the basic question, I really want to know how to debug
> a MEX file,
> use LCC as complier,
> >> mex mycalc.c
> >> mycalc(3+5i)
> May someone can help that if i want to ...matlab mex file
I want to create a mex file to be called by matlab. I have done all
the basic stuff and got the examples to work. But now I want to
create a much more ellaborate external c program. But all my calles
to things like "strcta" or "CreateFile" which works well in MSVC6.0
fials to compile and link here.
How do I do this?
henry terhani wrote:
> I want to create a mex file to be called by matlab. I have done all
> the basic stuff and got the examples to work. But now I want to
> create a much more ellaborate external c program. But all my calles
> to thin...Matlab+VS 2008
Does anybody know whether it is possible to compile mex file under
Visual Studio 2008 IDE?
I found this instruction:
which is similar to what can be found in a documentation.
Setting options according either to the instruction or to the
(the only difference is additional option /export:mexFunction /dll)
looks like this:
/VERBOSE /OUT:"<proper path>\mex_decode.mexw32" /NOLOGO /MANIFEST /
does any1 have idea how to convert "Matlab-Mex file" to c/c++ code ?
I have 2 files;
and I want to see the contents of these files and edit them..If there is not any convertor,is it possible to edit these files with an editor?
thanks in advance
> I have 2 files;
> and I want to see the contents of these files and edit them..If there is not any convertor,is it possible to edit these files with an editor?
> thanks in advance
There is no converter. You ha...how to call matlab file to another matlab file
i am working on simulation of power system using matlab. for that i
have written codes for generation side and line side separately. Now i
want to use the result of generation file to line file....so how can i
use the result of one file to another....
eg i have gen.m file from that i can get hourly gen data....now i want
to compare that data to line.....and line modelling is done in
separate file line.m so i want to call result of gen.m file to line.m
waiting for ur valuable suggestion
...How to debug a mex file
My programming is like this:
(1) I have a main programming main.m
(2)In main.m I have a for loop to call c programming
When executing it.Maybe i=1:60 There is no fault.But suddenly,It tells me a segment err.
How can I debug it?
Someone told me to use valgrind to see the primary memory error?
How to debug the valgrind with matlab.
Or is there any other tools I can use?
Thank you for your attention
On 25 Des, 14:54, "zedong " <zdon...@gmail.com> wrote: