Is it possible to read C/C++ code in matlab and the other way around too? Hi, as long as C or C++ are written in text files you can edit them in the matlab editor. To see the special character of C or C++ coding language, in the editor go to menus: file>preferences>Edito/Debugger>language and on popup "Language" select "C/C++". This does not allow you to run the C/C++ code, just to view it i nicer way... regards, chris saneman <asdfsdf@asd.com> wrote in message <frl846 $f8i$2@news.net.uni-c.dk>... > Is it possible to read C/C...

Hi, I am reading the help documents about how to program matlab and C C++ together and my questions are a little bit general. It seems that are several ways to call matlab in C C++ and another several ways to call C C++ in matlab. Please correct me if I am wrong or missing something when I try to list them. To call matlab code in C C++, are there two methods available? The first one is Matlab engine and the second one is to use MATLAB Compiler mcc to create C or C++ shared libraries from your MATLAB code. To call C C++ in matlab, are there also two methods? The first one is to call funct...

I'm relatively new to the world of Matlab. I want to call my matlab own code from a C/C++ program on a machine with matlab installed. Do I need to compile the matlab code using matlab compiler tool or the matlab engine is enough for this? Thanks a lot for your help On Nov 28, 10:03 am, "Paeo Campigotto" <campigo...@dit.unitn.it> wrote: > I'm relatively new to the world of Matlab. > I want to call my matlab own code from a C/C++ program on a > machine with matlab installed. > Do I need to compile the matlab code using matlab compiler > tool or the matla...

I am working on conversion of .m files to c/c++. I am using the MATLAB compiler version 3.0 and MATLAB version 6.5.1. There seem to be a few functions which do not seem to get converted. The error i got while using functions like TRAIN, NETWORK and INIT (all neural-networks related functions used in the general neural network programs, newpnn.m etc) is The MATLAB compiler does not currently support MATLAB object oriented programming and the functions TRAIN , NETWORK and INIT would produce a run-time error. Could anyone please tell me as to how i can circumnavigate this problem or solve this...

I'm relatively new to the world of Matlab. I want to call my matlab own code from a C/C++ program on a machine with matlab installed. Do I need to compile the matlab code using matlab compiler tool or the matlab engine is enough for this? Thanks a lot for your help ...

Hi everybody! My problem can be described as follows. I have a tool in Matlab that requires calling an optimisation algorithm in C. This algorithm consists of several C-files, one of which contains the function to be minimised (CFUNCTION), and another is the main algorithm file (CMAIN). Now what I want to do is to call Matlab from CFUNCTION or CMAIN and specify my custom function (MFUNCTION) to be minimised. So, I'm calling Matlab from C from Matlab. I'm a newbie in C and MEX files. Should I rewrite CMAIN as a MEX file and include CFUNCTION in this and then use mxCallMATLAB? Or can...

I'm trying to create an object inside C++ and then pass it to Matlab via en= gPutVariable. It seems I can create a struct // Create a float array mxArray *acq_data =3D mxCreateNumericMatrix(0, 0, mxSINGLE_CLASS); float *data =3D (float *)mxCalloc(M*N, sizeof(float)); mxSetData(acq_data, data); mxSetM(acq_data, M); mxSetN(acq_data, N); // Convert to struct const char *fieldname =3D "data"; mxArray *acq_struct =3D mxCreateStructMatrix(1,1,1, &fieldname); mxSetField(acq_struct,i,"data",acq_data); // Convert to class ?? Does it work? if (j=3D=3D1...

Hi I've been asking on the net how to use MEX properly so that I can use C/C++ in MATLAB, but information is not forthcoming. There seems to be a lot on using MATLAB in C/C++ but not the other way around. I understand Mathworks is trying very hard to sell the Matlab Compiler, but even so, why is it SO hard to get information about MEX? Or is it that I've missed something very fundamental, meaning that I'm struggling over something that is actually quite easy? Any thoughts and info would be great. Thanks BullDog BullDog wrote: > Hi > > I've been asking on the net ...

I was wondering if there is a way to control Matlab event loop? Is there a way to make Matlab be able to respond to key presses in Matlab GUI or call from C (via engine) and to either pause or stop its execution. I know that Matlab can execute items on its 'event queue' when pause() or drawnow() etc are called, but that means that I have to explicitly put those in the code. Is there some way that would be more elegant? Second question is about the 'event queue.' How does one add things to the event queue? How can I add a call from, say, C engine such as evalString() to the ev...

I know that this has probably been asked before but I desperately need to do this. I have simple scripts in Matlab and I would like to see what they look like in C language. Can anyone help me with this? I'm not a great C programer so this would help me immensly if I could see various examples of things that I have written in Matlab in C Thank you. Hi finiteguy, check the MATLAB help for the MATLAB Compiler, if you have. Regards, Stefan Hi Stefan, I tried that and got no help. Nothing about Matlab compiler. I kew that years ago there was a simple command but I lost it. On Mon, 30...

Hello, I have a code. I need to change that code for matlab. I am wandering if there is an article so I can read before start. Thank you "Ongun Palaoglu" <ongun@mac.com> wrote in message <hae0r2$erv$1@fred.mathworks.com>... > Hello, I have a code. I need to change that code for matlab. I am wandering if there is an article so I can read before start. Thank you check matlab help and read mex file creation. its pretty simple to call c from matlab. "Maya " <priyaravi_22@yahoo.co.in> wrote in message <hae4mr$nf6$1@fred.mathworks.com>... > "Ongun Palaoglu" <ongun@mac.com> wrote in message <hae0r2$erv$1@fred.mathworks.com>... > > Hello, I have a code. I need to change that code for matlab. I am wandering if there is an article so I can read before start. Thank you > > check matlab help and read mex file creation. its pretty simple to call c from matlab. Dear Maya, I do not want to call the function. I want to change the language to Matlabs own language . "Ongun Palaoglu" <ongun@mac.com> wrote in message <hae5r1$59l$1@fred.mathworks.com>... > "Maya " <priyaravi_22@yahoo.co.in> wrote in message <hae4mr$nf6$1@fred.mathworks.com>... > > "Ongun Palaoglu" <ongun@mac.com> wrote in message <hae0r2$erv$1@fred.mathworks.com>... > > > Hello, I have a code. I need to change that code for matlab. I am wandering if th...

I am trying to call and debug matlab code via C/C++. i am able to run the engdemo.c program but I cannot stop the debugger in a test MatLab file to see if this can be done. I would like the C/C++ program to spawn the MatLab environment so that I may have access to all the MatLab debugging tools but be able to read any inputs from the C/C++ calling function and return any modifications to those values back to the C/C++ function as well. I am running MatLab 6.5.1.199709 v 13. Does MatLab 7 have any added capability that I would need to do this? Reginald Robertson wrote: > > > I am tr...

undefined ...

Hello, I have a problem calling C code from Matlab. The mex file compilation is ok. When I run the program Matlab (7.3) crashes. Below is the mexFunction code. Any idea is welcome. (I think the main part of the code (middle part) is not useful for the crash problem, but I put it anyway). //########################################################### #include "math.h" #include "mex.h" void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // Standard variables int p,r,h,i,j,f,w; // Indices for loop int MAX_NBM = 1000; int MAX_DIM = 10; int MAX_NB_CLUST = 20; double *SF, *km, *new_data; int size, dim, K, nbm, aux_size, count_bis, count_aux; double diam_max, diam, vec1_p, vec2_p, dist_min, dis; int combi[1000000][2]; int dist_aux[1000000][2]; /* Check for proper number of arguments. */ if (nrhs != 5) { mexErrMsgTxt("5 input required."); } else if (nlhs > 1) { mexErrMsgTxt("Too many output arguments"); } // Input parameter (MATLAB) new_data = mxGetPr(prhs[0]); size = (int)mxGetScalar(prhs[1]); dim = (int)mxGetScalar(prhs[2]); K = (int)mxGetScalar(prhs[3]); km = mxGetPr(prhs[4]); // Output parameter (MATLAB) plhs[0] = mxCreateDoubleMatrix(1,1,mxREAL); SF = mxGetPr(plhs[0]); // Other variables nbm = size/dim; // Number of points printf("Taille: %d\n",nbm); printf("Dimension: %d\n",dim); //#############################...

I am currently trying to create a C++ - Matlab function call(on a Windows platform) where I am able to debug the Matlab function via the edit/debugger. Yes, I have used the MatLab Engine calls and the COM interface. However when i attempt to debug via the edit/debugger, I get the following error message sent to STDOUT: buffer 0x0012fda4 "Warning: Debug commands not available when using MATLAB as Engine. > In <a href="error:c:\matlab7\bin\win32\cMatlabTest.m,4,1">cMatlabTest at 4</a> Checked all 17 cache memory tables. Found no corrupted tables. We also at...

Hello All, Please can I get some guidance on how to Convert a structure from Matlab code to C code using Matlab Compiler. Kind regards Sammy ...

I tried to find matlab.h, matlab.hpp in my system, however, I did not find them. I am using MATLAB 7.0, is that this version does not include MATLAB C/C++ library? Which version can I find it? Hi, MATLAB 7.0 or MATLAB Compiler 4 doesn't include C/C++ Library. MATLAB Compiler 3.0 includes C/C++ Library. Hope it helps. LePhan. ------------------------------------- see our MATLAB C/C++ Book at www.LePhanPublishing.com Tommy wrote: > > > I tried to find matlab.h, matlab.hpp in my system, however, I did > not > find them. > I am using MATLAB 7.0, is that this version does not include MATLAB > C/C++ library? > > Which version can I find it? ...

hallo firends, Can any body help me write this below code into MATLAB object oriented code or C code form please? M=50; % total number of periods. (choose for 1s duration) f0 = 50; % fundamental AC frequency T0 = 1/f0; %fundamental AC period T = M*T0; %Time for M periods (integer M) N=30; % sample points per period. dt = T0/N; % Sample at N points per period (integer N > 20) t = dt*[1:M*N-1]; % Sampling time array A0=120/2; % amplitude of AC signal. Divide by 2 or maybe sqrt (2) ? AC=A0*sin(f0*t*2*pi); % create AC signal. DC0=50; % DC amplitude DC=DC0*ones(1,length(t)); % create a DC signal that is constant of length t S=AC+DC; % total signal is AC signal + DC signal figure(1); plot(t,S); % plot signal. xlabel('time');ylabel('Signal'); title('Total Signal'); % filter components fAC=S-mean(S); % here is the AC component fDC=mean(S); % here is the DC component figure(2); plot(t,fAC,'r',t,fDC,'b'); % plot AC and DC signals legend('AC','DC'); xlabel('time');ylabel('Signal'); title('Signal with only AC component'); figure(3); plot(t,fDC,'b'); % plot DC signal legend('DC'); xlabel('time');ylabel('Signal'); title('Signal with only DC component'); figure(4); % best to plot in Fourier domain u=abs(fftshift(fft(S))); NumPoints=length(t); freq=(1/dt)*[1:NumPoints]/NumPoints; % create frequency axis freq=fre...

Hello, I have a problem calling C code from Matlab. The mex file compilation is ok. When I run the program Matlab (7.3) crashes. Below is the mexFunction code. Any idea is welcome. (I think the main part of the code (middle part) is not useful for the crash problem, but I put it anyway). //########################################################### #include "math.h" #include "mex.h" void mexFunction (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { // Standard variables int p,r,h,i,j,f,w; // Indices for loop int MAX_NBM = 1000; int MAX_DIM = 10; in...

im working on a project using matlab. i want to use some of the already writen codes in C++. i want to use these codes in my project rather than writing them from scratch. is there some way or a chunk of code that might convert C++ code to matlab code or a ".c" file to ".m" file. please if anyone knows do let me know at the earliest.thanks "fatima " <fatima_naseem2002@yahoo.com> wrote in message <i8ugqn$e9p$1@fred.mathworks.com>... > im working on a project using matlab. i want to use some of the already writen codes in C++. i want to use these c...

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

Hello, I tried to install matlab in c:\program files\matlab but when i choose the folder it says it doesn't allow spaces in it. Should Matlab be installed only in the root? How can i install Matlab in c:\program files\matlab? Thanks, shapper > I tried to install matlab in c:\program files\matlab but when i > choose the folder it says it doesn't allow spaces in it. That is true > Should Matlab be installed only in the root? You can install it in any directory that doesn't contain a space in the path. > How can i install Matlab in c:\program files\matlab? You ca...

How to call matlab functions directly from C++ without calling matlab engine. as it is described in this tutorial: http://www.codeproject.com/samples/matlab_cpp.asp I have tried to do something similar in Visual Studio 2005 [Matlab 7, r14] #include <mclcppclass.h> .... mwArray A, B, C; A = magic(mwArray(5)); B = transpose(A); .... but it doesn't compile. I got following errors: error C3861: 'magic': identifier not found error C3861: 'transpose': identifier not found etc... I was looking for header files with declarations of this functions in matlab directory...

SUBJECT : Using matlab Engine. (Or Calling matlab from C). I have a problem in Calling matlab from C. Did any body used it before. I'm getting problem while Linking at Runtime.(During Build.. not while compiling). It Shows The Following Error Message. Error LNK2001 unresolved External Symbol. Even I couldn't Run the example program given by matlab. I tried engdemo.c and engwindemo.c given in $matlab/extern/examples/eng_mat/ I will truely, apprieciate all your help in this regard. Thanks, Kiran Chintal. hello, which compiler do you use? I tried BloodShed, and it didn't co...

Hi. I would like to convert a short .m file to C or C++ code. I have MATLAB compiler version 4.6. I used the following commands: mbuild -setup mcc -c MyFunction.m I recived the following error messages: "??? 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." "Error: File "MyFunction" is a script M-file and cannot be compiled with the current Compiler. You may be able to correct this by converting this script into a fu...

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/14/2016 6:02:55 PM