f



Using mex files in Matlab

I often translate the most computationally expensive routines in C++ using IT++ library, then I call these routines from Matlab as mex files. IT++ library (https://sourceforge.net/apps/wordpress/itpp/) uses blas/acml functions to handle matrix/vector operations and is entirely written in C++.

The problem seems to be that Matlab does not handle properly calls to routines from blas/acml libraries. Both, Matlab and IT++ use these libraries, but they are stored in different places.

Short example:

buf = intrinsic_coded(i*nb_outputs,(i+1)*nb_outputs-1);

The line above is executed from a C++ program, however in a mex file this gives an error:

Program received signal SIGSEGV, Segmentation fault. 0x00007fffe86528f1 in mklblasdef_dcopy () from /usr/local/matlab/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/mkl.so

On my system, openSUSE 11.1, IT++ library is linked against ACML 4.3.0, while mkl.so library comes from Matlab (7.8.0) installation folder.

Any idea how should I fix this ?
0
cristeab (60)
10/13/2009 4:03:04 PM
comp.soft-sys.matlab 211266 articles. 24 followers. lunamoonmoon (257) is leader. Post Follow

3 Replies
799 Views

Similar Articles

[PageSpeed] 13

On 13 Okt, 18:03, "Bogdan Cristea" <crist...@gmail.com> wrote:
> I often translate the most computationally expensive routines in C++ usin=
g IT++ library, then I call these routines from Matlab as mex files. IT++ l=
ibrary (https://sourceforge.net/apps/wordpress/itpp/) uses blas/acml functi=
ons to handle matrix/vector operations and is entirely written in C++.
>
> The problem seems to be that Matlab does not handle properly calls to rou=
tines from blas/acml libraries. Both, Matlab and IT++ use these libraries, =
but they are stored in different places.
>
> Short example:
>
> buf =3D intrinsic_coded(i*nb_outputs,(i+1)*nb_outputs-1);
>
> The line above is executed from a C++ program, however in a mex file this=
 gives an error:
>
> Program received signal SIGSEGV, Segmentation fault. 0x00007fffe86528f1 i=
n mklblasdef_dcopy () from /usr/local/matlab/bin/glnxa64/../../bin/glnxa64/=
.../../bin/glnxa64/mkl.so
>
> On my system, openSUSE 11.1, IT++ library is linked against ACML 4.3.0, w=
hile mkl.so library comes from Matlab (7.8.0) installation folder.
>
> Any idea how should I fix this ?

You have two different versions of BLAS, with different function
interfaces, that you want to link in with the same application at
the same time? I would be very surprised if it is possible to
interchangeably use two dynamic libraries that contain the same
entry point names, in the same application.

Seems one of two equally bad situations would occur:

1) The linker recognizes the first entry point on the list
   of libraries, and use the same object code everywhere.
   In this case the calls tha intend to use the other version
   might experience run-time problems like the ones you see.
2) The linker scans the inventory lists of all the libraries
   listed, and detects the ambiguity. If so, it would not
   link the object code up to an executable at all.

In other words, be prepared that what you ask for might not
be possible.

Apart from that, I would have tried to see if the C++ MEX
routine could be linked to a static, self-contained object
code. If this is possible, I would compile up this static
library first, independently from MEX, and then link this
static, self-contained library in trough the MEX interface.

Since this library is self-contained, it would never need
to call external BLAS functions, and no ambiguities would
occur.

Rune
0
allnor (8509)
10/13/2009 4:22:40 PM
"Bogdan Cristea" <cristeab@gmail.com> wrote in message <hb28bo$i45$1@fred.mathworks.com>...
> I often translate the most computationally expensive routines in C++ using IT++ library, then I call these routines from Matlab as mex files. IT++ library (https://sourceforge.net/apps/wordpress/itpp/) uses blas/acml functions to handle matrix/vector operations and is entirely written in C++.
> 
> The problem seems to be that Matlab does not handle properly calls to routines from blas/acml libraries. Both, Matlab and IT++ use these libraries, but they are stored in different places.
> 
> Short example:
> 
> buf = intrinsic_coded(i*nb_outputs,(i+1)*nb_outputs-1);
> 
> The line above is executed from a C++ program, however in a mex file this gives an error:
> 
> Program received signal SIGSEGV, Segmentation fault. 0x00007fffe86528f1 in mklblasdef_dcopy () from /usr/local/matlab/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/mkl.so
> 
> On my system, openSUSE 11.1, IT++ library is linked against ACML 4.3.0, while mkl.so library comes from Matlab (7.8.0) installation folder.
> 
> Any idea how should I fix this ?

Looks like you are running a 64-bit setup. Are you trying to combine 32-bit s/w with 64-bit s/w? If so, that won't work. The MATLAB BLAS libraries, at least on a PC, have the standard BLAS names. e.g., one of the routines is DCOPY. So it would be typical to find the name dcopy or _dcopy in the exported names for the C BLAS library. But in your error message above the routine name is mklblasdef_dcopy, leading me to believe that it is somehow a custom BLAS routine version of DBLAS with possibly a different argument signature. Are you trying to link in the MATLAB BLAS library *and* the other BLAS library? Could you show your exact mex compiling commands?

James Tursa
0
10/13/2009 7:06:05 PM
"James Tursa" <aclassyguy_with_a_k_not_a_c@hotmail.com> wrote in message <hb2j2t$ke8$1@fred.mathworks.com>...
> "Bogdan Cristea" <cristeab@gmail.com> wrote in message <hb28bo$i45$1@fred.mathworks.com>...
> > I often translate the most computationally expensive routines in C++ using IT++ library, then I call these routines from Matlab as mex files. IT++ library (https://sourceforge.net/apps/wordpress/itpp/) uses blas/acml functions to handle matrix/vector operations and is entirely written in C++.
> > 
> > The problem seems to be that Matlab does not handle properly calls to routines from blas/acml libraries. Both, Matlab and IT++ use these libraries, but they are stored in different places.
> > 
> > Short example:
> > 
> > buf = intrinsic_coded(i*nb_outputs,(i+1)*nb_outputs-1);
> > 
> > The line above is executed from a C++ program, however in a mex file this gives an error:
> > 
> > Program received signal SIGSEGV, Segmentation fault. 0x00007fffe86528f1 in mklblasdef_dcopy () from /usr/local/matlab/bin/glnxa64/../../bin/glnxa64/../../bin/glnxa64/mkl.so
> > 
> > On my system, openSUSE 11.1, IT++ library is linked against ACML 4.3.0, while mkl.so library comes from Matlab (7.8.0) installation folder.
> > 
> > Any idea how should I fix this ?
> 
> Looks like you are running a 64-bit setup. Are you trying to combine 32-bit s/w with 64-bit s/w? If so, that won't work. The MATLAB BLAS libraries, at least on a PC, have the standard BLAS names. e.g., one of the routines is DCOPY. So it would be typical to find the name dcopy or _dcopy in the exported names for the C BLAS library. But in your error message above the routine name is mklblasdef_dcopy, leading me to believe that it is somehow a custom BLAS routine version of DBLAS with possibly a different argument signature. Are you trying to link in the MATLAB BLAS library *and* the other BLAS library? Could you show your exact mex compiling commands?
> 
> James Tursa

I am trying to compile my C++ function into a mex file using static libraries. I use my own static library, libsiso.a, as an open source library, libitpp.a. Here is the compilation command and the error I get:

mex -I/home/bogdan/C++/SISO C_SISOmud.cpp LDFLAGS='$LDFLAGS -static' -litpp -L/opt/acml4.3.0/gfortran64_mp/lib -lacml_mp -L/home/bogdan/C++/SISO -lsiso -output C_SISOmud_s.mexa64

Warning: You are using gcc version "4.3.2".  The earliest gcc version supported
         with mex is "4.1".  The latest version tested for use with mex is "4.2".
         To download a different version of gcc, visit http://gcc.gnu.org

/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: /usr/lib64/gcc/x86_64-suse-linux/4.3/crtbeginT.o: relocation R_X86_64_32 against `__DTOR_END__' can not be used when making a shared object; recompile with -fPIC
/usr/lib64/gcc/x86_64-suse-linux/4.3/crtbeginT.o: could not read symbols: Bad value
collect2: ld returned 1 exit status

    mex: link of ' "C_SISOmud_s.mexa64"' failed.

make: *** [C_SISOmud_s.mexa64] Error 1

Could you tell me what went wrong ?
0
cristeab (60)
10/15/2009 4:11:23 PM
Reply:

Similar Artilces:

Using GotoBLAS2 in a MATLAB MEX file (shared library help?)
Hi, I have been having a lot of trouble using the GotoBLAS2 library with a C program, which I want to call via the MEX interface. Basically, I have some numerical optimization code in C that I want to use in a MATLAB script. I am trying to link the code to GotoBLAS2 for a fast BLAS library. Based on an example I saw of the use of this code, I am compiling it with the linker options -llapack -lgoto2 to link it with GotoBLAS2. I have a separate stand-alone program (non-MEX) which compiles this way and works fine. However, when I compile the MEX version and then run it, the LAPACK functions I call end up going to the MATLAB LAPACK libraries, which do not seem to be compatible. For example, my code contains a LAPACK call such as int work_sz = -1; dsytrf("U", (int *)&m, NULL, (int *)&m, NULL, (LM_REAL *)&tmp, (int *)&work_sz, (int *)&info); I understand this code is supposed to make a direct call to a FORTRAN library, since C and FORTRAN have the same calling conventions (?), and in my stand-alone program it works. However, if I execute the same call using MATLAB's gdb debugging, I see the error MKL ERROR: Parameter 7 was incorrect on entry to DSYTRF. This tells me that the "dsytrf_" symbol is actually being loaded from the Intel Math Kernel Library (which comes with MATLAB) instead of the LAPACK my stand-alone program uses (which is in /usr/lib/liblapack.so). So my question is this: how can I choose which LAPACK library my MEX-...

Why can't Fortran-mex files be compiled on matlab V5.3 and run on matlab V6?
Hi, does anyone know why Fortran-mex files can't be compiled on matlab V5.3 and run on matlab V6? For example: if I compile the example-program (shipped with matlab) timestwo.f on matlab version 5.3 (R11) and try to run it on matlab version 6+ (R12 or R13), I get the error message: "Unable to load mex file: E:\timestwo.dll. The specified module could not be found. ??? Invalid MEX-file" Likewise if I compile it on matlab version 6.1 (R12), I get a similar error message if run on matlab version 5.3 (R11). However, if I run it on matlab version 6.5 it works OK. If I try the same experiment with the corresponding example file written in C, timestwo.c, I get no such problems. Why is that? Per A. Hi Per, usually MEX-files need to be compiled with the MATLAB version you want it later to run with. The reason is, that the code links against the current dynamic libraries (DLLs), which may change from version to version. You may have luck that it works (see your example of timestwo.f), but you should never rely on this. Titus "Per A. Brodtkorb" <Per.Brodtkorb@ffi.no> wrote in message news:eecb303.-1@webx.raydaftYaTP... > Hi, > > does anyone know why Fortran-mex files can't be compiled on matlab > V5.3 and run on matlab V6? > > For example: if I compile the example-program (shipped with matlab) > timestwo.f > on matlab version 5.3 (R11) and try to run > it on matlab version 6+ (R12 or R13), I ...

What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit)
What is the best way to import Excel files, with stock data, into Matlab? I’m using Matlab R2010b (64-bit) I’m trying to import historical prices of stock data. Matlab keeps cutting off the header of each column; it gives me only values. I am thinking that this is a data-type-mixing-issue, or whatever it’s called. I have ‘Dates’ in ColumnA, and ‘MSFT’, ‘PWER’, ‘KO’, and ‘SBUX’, in ColumnB-ColumnE. Basically, if I put the Excel file in my Matlab folder and double-click the file, I see the values in a matrix (no dates and no headers), I hit ‘Next’. Then, I see only one option; one radio button is enabled – ‘Create variable matching preview’. The other two options, ‘Create vectors from each column using column names’ and ‘Create vectors from each row using row names’ – both are greyed out. I’ve seen videos, on YouTube and on the Matlab site, where people import excel data and these options are NOT greyed out. No matter what I do, there options are ALWAYS greyed out. The problem is, when I click ‘Finish’ in my ‘Workspace’ I have a variable named ‘data’ all values in a 575x4 matrix, but I have NO DATES and I have NO HEADERS on the columns. All of this seems to go into another variable, called ‘textdata’; all dates and headers ate in textdata. This is VERY inconvenient. I’m trying to analyze some stock data and I have no headers, so I have no idea which stock is which (I can figure it out, but I think Matlab should do this for me). Also, I have no dates corresponding to ...

Shall i use the misrosoft Visual c++ code from a m-file generated from matlab in Visual C++ with out matlab runtime environment
undefined ...

C++ Mex file crashes matlab on 64bit linux, but not 32 bit windows, but program runs fine outside Matlab
Hello, I have written a mex gateway function to a C++ class. If I compile this mex function on 32Bit windows using R2008a I have no problems. If I compile and run on Matlab R2011a running 64bit Scientific Linux (a version of Red Hat Enterprize Linux) matlab exits with a segfault when the mexfunction is called, although it appears to run about halfway through the program. The C++ class can be compiled and run (with a main function) outside of Matlab on both platforms with no errors. I am using Microsoft Visual C++ Express Edition on the windows machine, and gcc 4.4.5 on the Linux machine. Can anyone suggest what the cause of this might be and how I can I fix it? I am having a hard time debugging on Linux as I do not have access to a graphical debugger for use with matlab and am unfamiliar with gdb. This is compounded by the fact that the program compiles and runs fine when compiled as a standalone program. A zip file containing the code and data files necessary to reproduce the problem can be downloaded from http://www.see.ed.ac.uk/~s0237326/downloads/mexcrash.zip. This zip file contains the .m and .cpp source code, and a text file for testing (Temp.fem). The file fmehsersetup.m shows the commands I am using to compile. The file Test_mexfmesher.m runs the mexfunction with an appropriate input for testing. The mex gateway function is mexfmesher.cpp, it calls the fmesher class which is made up of the files in the fmesher directory. Below is a backtrace from the se...

Creating DLL in Matlab and using them in Matlab?
Hi, is it possible to create dll in Matlab and then using it in other Matlab apllication? I've made a simple function and put it into dll. But when I try to use this library in other apllication written in matlab it doesn't works. Any idea? -- Pozdrawiam, e-Shrek hi e-shresk, I once created a matlab dll, and called it in c code. it worked. I guess you have to check whether you dll was built correctly or not. ps. why don't u call matlab function directly? Dnia Mon, 26 Oct 2009 07:19:04 +0000 (UTC), Jun napisa�(a): > hi e-shresk, > > I once created a matlab dll, and called it in c code. it worked. Hmmm. The function is very simple: ========================== function var_o = testlib(var_i) if var_i == '1', var_o = 'jest'; else var_o = 'brak'; end ========================== Compilation: mcc -W lib:xlib -T link:lib testlib After it, I have *.dll *.lib *.h Tryin' to load library: loadlibrary('xlib.dll','xlib.h'); The result is: Warning: Warnings messages were produced while parsing. Check the functions you intend to use for correctness. Warning text can be viewed using: [notfound,warnings]=loadlibrary(...) > In loadlibrary at 394 Where is the problem? > ps. why don't u call matlab function directly? I have a pack of functions that I wouldlike to use with few different matlab compiled programs. -- Pozdrawiam, e-Shrek On Oct 26, 1:47=A0pm, e-Shrek <e-Shrek.wyt...@wytni...

creating exe file from m file using MATLAB R2009a version
how to create exe file from m file in R2009a version of matlab? when trying to create we get the following error >> mcc -m vk1234 Select a compiler: [1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2009a\sys\lcc [0] None Compiler: 1 Trying to update options file: C:\Documents and Settings\student\Application Data\MathWorks\MATLAB\R2009a\compopts.bat From template: C:\PROGRA~1\MATLAB\R2009a\bin\win32\mbuildopts\lcccompp.bat Done . . . 'cmd' is not recognized as an internal or external command, operable program or batch file. Error: An error occurred while shelling out to mbuild (error code = 1). Unable to build executable (specify the -v option for more information). ??? Error using ==> mcc Error executing mcc, return status = 1 (0x1). PLEASE REPLY as soon as possible On Apr 7, 4:06=A0am, "yatin kharbe" <yatinkha...@yahoo.com> wrote: > how to create exe file from m file in R2009a version of matlab? > Trying to update options file: C:\Documents and Settings\student\Applicat= ion Data\MathWorks\MATLAB\R2009a\compopts.bat ------------------------------------------------ Is this a student edition? I don't believe the student edition allows compilations. ...

slow optimization using nonlcon with GA within matlab toolbox and mixed integer problem using GA within Matlab
greeting all, i'm using nonlcon(nonlinear inequality constraint) with GA from the toolbox provided by matlab. does anyone notice the extreme slowlness in evaluating nonlinear constraint as compared to other linear constraint? my problem for nonlinear constraint is as follow c(1)=x+y^2-2*ones(N,1) where x and y are Nx1 vector. which means if N increases, the size of constraint increases. and to clarify, the min problem is sometime like min c'z where z=[x;y], which means x and y are some range of variable within z(just a matter of problem formulation) well, is there anyone with other alternative or is it possible or method in including non-linear constraint directly to fitness function? (well, actually nonlcon deals nonlinear constraint by using Augmented Lagrangian Pattern Search from what i see from the help file, or am i wrong?) and one more question, is there anyone that attempt to attempt to apply mixed integer problem into the GA in matlab? For now, i can only switch before pure integer or pure real number problem, but not mixed at the moment. I will be trying to add in some repair operator to fix up the variable that needs to be integer and other remaining in real number. I'm not sure why you are using ga to solve your problem. Did you find fmincon unsatisfactory in any way? Alan Weiss MATLAB mathematical toolbox documentation On 5/10/2011 11:53 PM, terry wrote: > greeting all, > > i'm using nonlcon(nonlinear inequality constraint)...

how to add a file using Matlab's zip command to an exisiting zip file?
I was using matlab central's tool called exportToZip() to package an m file and its dependencies m files into one zip file. The problem is that this tool does not package a .fig file as well, that corresponds to an .m file (assuming such one exist, example for GUIDE application). So, in my Matlab script, I detect this, and then tried to add the .fig file to the zip file that was created. But after looking at the zip() command, it does not seem to support adding a file to a zip file? Or Am I missing something? I am using 2010a on windows. How else would one add a file to a zip file using Matlab? I can try using the system() command, but windows 7 does not seem to have a zip command at the DOS level. thanks --Nasser On 2/15/2012 12:11 AM, Nasser M. Abbasi wrote: > I was using matlab central's tool called exportToZip() to > package an m file and its dependencies m files into one zip file. > > The problem is that this tool does not package a .fig file > as well, that corresponds to an .m file (assuming such > one exist, example for GUIDE application). > > So, in my Matlab script, I detect this, and then tried > to add the .fig file to the zip file that was created. > > But after looking at the zip() command, it does not seem > to support adding a file to a zip file? > > Or Am I missing something? > > I am using 2010a on windows. How else would one add a file > to a zip file using Matlab? I c...

Which matlab for a given mex file?
Dear Mex-file users, I wanted to know whether someone would have a solution to manage multiple matlab versions (and thus multiple complied form of a given mex files) : the problem that I have is that we have different versions of matlab using a common home-made toolbox which contains some mex files. And since mex file extension is the same independently of the matlab version that has created it and there is no backward compatibility, each time one uses a different matlab version, one needs to recompile those mex file to use the toolbox. What would be your advice to allow these various matlab versions to use that toolbox whithout conflicting ? Does anyone have a working solution (e.g. having subdirectories named after the matlab version/release number/date and put mex files in it ...) ? Besides is there a way to tell which matlab version can bu used with a given compiled mex file (be it .dll , .mexglx or whatever) Thanks for your help. Karim "Karim N'Diaye" <kndiaye01_nospam@gmail.com> wrote in message news:hb9lt0$1nd$1@fred.mathworks.com... > Dear Mex-file users, > > I wanted to know whether someone would have a solution to manage multiple > matlab versions (and thus multiple complied form of a given mex files) : > the problem that I have is that we have different versions of matlab using > a common home-made toolbox which contains some mex files. And since mex > file extension is the same independently of the matlab versio...

Mex file crashes Matlab
Hello all, I created successfully a mex file. It is linked to an external dll and it worked fine (it returns correctly to matlab a vector). Recently I added an new function inside my c++ file which does not affect the result of the c++ function but is just used to improve some data manipulation. By the way, this function works quite well in a simple c++ file and I have already used many times in other c++ files (no-mex files). After added this function my matlab crashes and returns me this error: MATLAB crash file:C:\DOCUME~1\MILCEMEA~1.VAA\LOCALS~1\Temp\matlab_crash_dump.2996 ------------------------------------------------------------------------ Segmentation violation detected at Wed Jul 28 18:38:04 2010 ------------------------------------------------------------------------ Operating System: Microsoft Windows XP Window System: Version 5.1 (Build 2600: Service Pack 3) Processor ID: x86 Family 6 Model 7 Stepping 10, GenuineIntel Virtual Machine: Java 1.6.0_04-b12 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode Default Encoding: windows-1252 Fault Count: 1 Register State: EAX = ffff5df8 EBX = 00c2e01c ECX = ffffffff EDX = e06d7363 ESI = ffff5df4 EDI = 04f169ec EBP = 00c2e028 ESP = 00c2cf40 EIP = 04ec186e FLG = 00010286 Stack Trace: [0] qlDiscountFactors.mexw32:0x04ec186e(0x00c2e158 "x£", 0x00c2e0b8, 0x00c2e1fc, 0) [1] 0x00c2e20c(0x8b00032b, 0x04c483d8, 0x85e85d89,...

downloading a file using Matlab
Hi, I have a website which converts a file from .bib format to .json format. I was told that the website uses *Java script*. I have no idea about what Java script is. But, I would like to automate this conversion to obtain this .json file. Is this possible using Matlab? In case some1 needs more info about the web page which I have to communicate with, http://simile.mit.edu/babel/ best, arun. ...

Call Matlab m-file from Matlab Scrip Node
My problem with matlab script node is related to calling function in matlab.&nbsp; I created an m-file function that takes an imput temperature (from DAQ) and defines a material property.&nbsp; My matlab script node doesn't seem to recognize my function.&nbsp; I have placed the function in the folder the vi is currently located, but it doesn't read it.&nbsp; How do I get matlab script node to read the functions I create in matlab? Add the directory to matlab path, or call the .m file with it full name ( D:\..... \myfile.m) Let me clarify, &nbsp; I have pasted my matlab code into the matlab scrip node. &nbsp; In this code, I have called a subfunction that I have created. &nbsp; Example k(n)=k_c(T(n)) where k_c is a subfunction I have created. &nbsp; How do I get my code in the node&nbsp;to sucessfully read the subfunction k_c? &nbsp; &nbsp; &nbsp; As indicated, you need to add the directory where the .m file containing the function resides to the list of paths that are read in. This is your startup.m file. The other option is to do a "cd" command prior to calling your function to change to the directory where the .m file containing the function resides. Thanks for reiterating the information.&nbsp; My matlab script node is working properly.&nbsp; I had never used the "cd" command in matlab.&nbsp; I always set the working directory when I open the program, and put all the m files into t...

matlab 7.1 use matlab C++ math library
I wanna use matlab C++ math library into VC++6.0, but my matlab is 7.1. if i wanna use matlab C++ math library to programme, how can i setup my VC link?? why matlab7.1 doesn't have "extern->include->cpp" file??? In using matlab C++ math library , what difference between matlab 6.X and matlab7.1??? ...

close excel file using matlab
Dear Sir Shall i ask how to close excel file using matlab. i used (winopen) to open the excel file (i must open and close it using MATLB relating to my application) . Thanks in advance ...

how to generate Excell file using matlab
hi all. i have some problem to generate Excell file using matlab. The data that should be shown in Excell would be like this: Num0 Num1 Num2 total_sum 11 12 16 average 2.0 3.0 3.5 what is the source code in Matlab should i use to show that data in Excell? Thanks On Apr 12, 5:41=A0am, "nashriq " <adeque...@yahoo.com> wrote: > hi all. i have some problem to generate Excell file using matlab. The dat= a that should be shown in Excell would be like this: > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Num0 Num1 Num2 > total_sum =A0 =A011 =A0 =A0 12 =A0 =A0 16 =A0 =A0 > average =A0 =A0 =A0 2.0 =A0 =A03.0 =A0 =A03.5 > > what is the source code in Matlab should i use to show that data in Excel= l? Thanks doc save doc xlswrite Rune i've developed this source code: if no==0 sum_output=sum(y) mean_output=sum_output/150 out_new=vertcat(sum_output, mean_output); xlswrite('all_num.xls', out_new, 'All_Num', 'B2'); elseif no==1 sum_output=sum(y) mean_output=sum_output/150 out_new=vertcat(sum_output, mean_output); xlswrite('all_num.xls', out_new, 'All_Num', 'D2'); elseif no==2 sum_output=sum(y) mean_output=sum_output/150 out_new=vertcat(sum_output, mean_output); xlswrite('all_num.xls', out_new, 'All_Num', 'F2'); and the result shown in excell file: 522.1403214 548.7530088 564.1039542...

Read RTF file using MATLAB
Can any experts in MATLAB please provide some commands used to extract text from the RTF file? ...

How to use somat SIF file in matlab
I have measured some data with an instrument. I have very long mesures that in instrument format file (*.sif), each one take up 50mb. I have tried to export data in ascii format for importing in matlab, but then the data become long 2 GB and so it is impossibile to manage with my computer, while with the instrument analyzing softwork it is very rapid, but i can 't computerize some operations. Have you got an idea to manage that data? ...

Plotting an audio file using matlab
Hello, I am trying to plot an audio file using matlab. can i get a sinusoida plot of the audio file if so what matlab command is useful? any help is appreciated This message was sent using the Comp.DSP web interface o www.DSPRelated.com "hamseda79" <sadek_79@yahoo.com> wrote in message news:6ImdnQyKN8tA5BbfRVn-uA@giganews.com... > Hello, > > I am trying to plot an audio file using matlab. can i get a sinusoidal > plot of the audio file if so what matlab command is useful? > > any help is appreciated > > > > This message was sent using the Comp.DSP web interface on > www.DSPRelated.com Hi - the help command is most useful. after that the edit command is also very useful. best of luck - Mike "Mike Yarwood" <mpyarwood@btopenworld.com> wrote in message news:d6gc8c$6cm$1@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com... > > "hamseda79" <sadek_79@yahoo.com> wrote in message > news:6ImdnQyKN8tA5BbfRVn-uA@giganews.com... > > Hello, > > > > I am trying to plot an audio file using matlab. can i get a sinusoidal > > plot of the audio file if so what matlab command is useful? > > > > any help is appreciated > > > > > > > > This message was sent using the Comp.DSP web interface on > > www.DSPRelated.com > > Hi - the help command is most useful. Specifically, try 'help wavread' and 'help plot'. ...

Compile Matlab files to Mex c++
Hi everybody, I would like to optimise some parts of my program. I found some website where they said that using mcc file.m or mcc -x files.m to generate a mex file in cpp. However, when I tried this in matlab 2010, it didn't work: Unable to determine application type, since no wrapper function was specified. Please use the -W switch or specify application type via -m or -l. Type 'mcc -?' for further assistance. So, how is it possible to do this (mex files to be used in Matlab) ? Thanks you in advance ! Best regards, Duvi ...

Creating Mex-files from MATLAB code
Could someone please give a link to a good tutorial explaining how MEX-files can be created from Matlab code? P.S. I have a function 'myfun.m' that calls 4 functions 'myfun1.m'-'myfun4.m' Thanks. "Liana" wrote in message <j8mqmv$98v$1@newscl01ah.mathworks.com>... > Could someone please give a link to a good tutorial explaining how MEX-files can be created from Matlab code? P.S. I have a function 'myfun.m' that calls 4 functions 'myfun1.m'-'myfun4.m' > > Thanks. 1) Why do you want to create a mex file from your m-files? 2) Do you want MATLAB to create the mex file ala emlmex? Or are you talking about converting the whole thing to C code? James Tursa Well, I'm just trying to speed up my code. But I don't need a C++ or C shared library, because they operate more slowly due to calling Matlab built-in functions through DLL. Finally I came to the conclusion that my code cannot be compiled into MEX-file, because 'codegen funname.m' says that some of my important sub-functions are not supported for standalone code generation. Is it correct? "James Tursa" wrote in message <j8nb9i$38a$1@newscl01ah.mathworks.com>... > "Liana" wrote in message <j8mqmv$98v$1@newscl01ah.mathworks.com>... > > Could someone please give a link to a good tutorial explaining how MEX-files can be created from Matlab code? P.S. I have a function 'myfun.m' that call...

Running a C++ mex file from matlab
Hi ... I am a beginner in matlab.I am having some problems in interfacing c++ and matlab. I have a matlab program where I have to do arithmetic coding.I am implemting this in c++. Therefore I have a mex file.It has the void mexfuntion() with the arguments. The program is already tested on unix.Now my problem is to compile the matlab program in my windows system. So,I selected the compiler option using mex -setup and selected visual c++ editor.It was given in matlab help. Now I am confused what to do next?.Is there any document link that I can access for knowing how to compile.Do I need to link libraries or something like that.. Any suggestions would be really helpful.. Thanks.. "lakshmikanthan paramanathan" wrote in message <ilnq5q$j6c$1@fred.mathworks.com>... > Hi ... > I am a beginner in matlab.I am having some problems in interfacing c++ and matlab. > I have a matlab program where I have to do arithmetic coding.I am implemting this in c++. > Therefore I have a mex file.It has the void mexfuntion() with the arguments. > The program is already tested on unix.Now my problem is to compile the matlab program in my windows system. > So,I selected the compiler option using mex -setup > and selected visual c++ editor.It was given in matlab help. > > Now I am confused what to do next?.Is there any document link that I can access for knowing how to compile.Do I need to link libraries or something like that.. > > Any suggestions ...

.exe files using deploytool in MATLAB
Hey! I have three .fig files and m files associated with them. Is there any method using deploytool to make one .exe file from them? I want just one .exe file to be executed which will ask user which of the three .fig files he wants to run, and when he selects one of the three, .fig file and the m code associated with it is executed. Could you please suggest me how to do this? Write another MATLAB function that uses a GUI or the command prompt to ask this very question and then calls the appropriate .fig file. Compile all four MATLAB functions and the three .fig files into a single EXE. "Vaibhava Srivastava" <bakaitvaibhava@gmail.com> wrote in message news:io9lv6$l4p$1@fred.mathworks.com... > Hey! I have three .fig files and m files associated with them. Is there > any method using deploytool to make one .exe file from them? I want just > one .exe file to be executed which will ask user which of the three .fig > files he wants to run, and when he selects one of the three, .fig file and > the m code associated with it is executed. Could you please suggest me how > to do this? ...

time trial version of matlab compiled code using the matlab compiler
is there any way to create a time trial version of a program compiled using the matlab compiler? ...

Web resources about - Using mex files in Matlab - comp.soft-sys.matlab

Undocumented Matlab
Undocumented, unsupported and hidden features in Matlab

Matlab Upazila - Wikipedia, the free encyclopedia
... 23°21′N 90°42.5′E  /  23.35°N 90.7083°E  / 23.35; 90.7083 Coordinates : 23°21′N 90°42.5′E  /  23.35°N 90.7083°E  / 23.35; 90.7083 Matlab ...

Open Directory - Science: Math: Software: MATLAB
The MathWorks - Developers of MATLAB, Simulink and Stateflow. Offers products for data analysis, visualization, application development, simulation, ...

MATLAB Mobile on the App Store
Read reviews, compare customer ratings, see screenshots, and learn more about MATLAB Mobile. Download MATLAB Mobile and enjoy it on your iPhone, ...

The Smart Emergency Response System Using MATLAB and Simulink - YouTube
In the aftermath of an earthquake, every second counts for disaster victims. Imagine a system that can locate people quickly and help first responders ...

The A-Z of Programming Languages: MATLAB
What prompted the development of MATLAB?

Matlab: Invalid .NET Framework. Either the specified framework was not found or is not currently supported ...
If you are trying to compile Matlab into .Net framework, you might encounter this message, even though you have the .Net framework installed ...

Matlab edges closer to electronic design automation world
Matlab, one of the world's most widely used products for algorithmic development, has long occupied its own niche far removed from EDA and hardware ...

Can I/How do I use DMTCP with a parallel pool of MATLAB workers? · Issue #223 · dmtcp/dmtcp · GitHub
dmtcp - DMTCP: Distributed MultiThreaded CheckPointing matlab -nodisplay -r "parpool('local',4); parfor i=1:10, pause(1); fprintf('%i ',i); end; ...

Using MATLAB and SDR to Reverse Engineer 433MHz Messages
... so he focused on studying the methodology and the tools available for analyzing 433MHz RF transmission. He describes the process of using MATLAB ...

Resources last updated: 3/31/2016 3:06:58 AM