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-...

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) 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 ...

undefined ...

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...

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...

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. ...

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)...

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...

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...

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,...

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. ...

My problem with matlab script node is related to calling function in matlab. I created an m-file function that takes an imput temperature (from DAQ) and defines a material property. My matlab script node doesn't seem to recognize my function. I have placed the function in the folder the vi is currently located, but it doesn't read it. 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, I have pasted my matlab code into the matlab scrip node. In this code, I have called a subfunction that I have created. Example k(n)=k_c(T(n)) where k_c is a subfunction I have created. How do I get my code in the node to sucessfully read the subfunction k_c? 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. My matlab script node is working properly. I had never used the "cd" command in matlab. I always set the working directory when I open the program, and put all the m files into t...

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??? ...

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 ...

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...

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

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? ...

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'. ...

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 ...

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...

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 ...

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? ...

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

Undocumented, unsupported and hidden features in Matlab

... 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 ...

The MathWorks - Developers of MATLAB, Simulink and Stateflow. Offers products for data analysis, visualization, application development, simulation, ...

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

In the aftermath of an earthquake, every second counts for disaster victims. Imagine a system that can locate people quickly and help first responders ...

What prompted the development of MATLAB?

If you are trying to compile Matlab into .Net framework, you might encounter this message, even though you have the .Net framework installed ...

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 ...

dmtcp - DMTCP: Distributed MultiThreaded CheckPointing matlab -nodisplay -r "parpool('local',4); parfor i=1:10, pause(1); fprintf('%i ',i); end; ...

... 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