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

Hi, Help required getting the Matlab's C# COM example to work. This topic has poped up in a number of postings, but after reading all these I haven't completely resolved the problem. I am ruining Matlab R14PS3 and Visual Studio 2003 on XP Pro, and trying to implement the C# example given in the matlab help files, no need to repeat it here again. I referenced the MATLAB type library using Project/add Reference, the name space is recognized when building. Problem 1: I have seen other posts talk about a MATLAB interop assembly, what is this and what do I need to do to set it up correct...

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

Dear all, Can C++/STL/Boost do the vectorized calculation as those in Matlab? For example, in the following code, what I really want to do is to send in a vector of u's. All other parameters such as t, l1, l2, l3, etc. are scalars... But u is a vector. Thus, t6 becomes a vector. t9 is an element-wise multiplication... The following code was actually converted from Matlab. If vectorized computation is not facilitated, then I have to call this function millions of times. But if vectorized computation is okay, then I can send in just a u vector with batch elements a time. I have many such code in Matlab need to be converted into C++ with vectorization. Any thoughts? Thank you! double t5, t6, t7, t9, t11, t13, t16, t20, t23, t27, t32, t34, t36, t37, t38, t42, t44, t47, t48, t51, t52, t54, t59, t60, t61, t66, t67, t69, t74, t75, t76, t81, t82, t84, t87, t105, t106, t110, t112; t5 = exp(-t * l1 - t * l2 - t * l3); t6 = t * u; t7 = mu1 * mu1; t9 = u * u; t11 = kappa * kappa; t13 = 0.1e1 / (t9 * t7 + t11); > Dear all, > > Can C++/STL/Boost do the vectorized calculation as those in Matlab? > > For example, in the following code, what I really want to do is to > send in a vector of u's. > > All other parameters such as t, l1, l2, l3, etc. are scalars... > > But u is a vector. > > Thus, t6 becomes a vector. > > t9 is an element-wise multiplication... > > The following code was actually converted f...

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

We have a signal processing application for doing frequency analysis of acoustic signals. The original signal is captured in a C struct: -------------------------------------------- typedef struct _sig { unsigned long length; float *data; } Sig; -------------------------------------------- Typical length is 10M, so the size of the data is 10M*sizeof(float)=40M. We want to apply FIR filter on this signal using Matlab MCR. I have built a Matlab DLL using the deploytool from the Compiler toolbox. In the Matlab DLL there is Filt.m that includes somethin...

Hi, I want to access some functions/data from C or C++ into Matlab. So, is there any way apart fromthe Mex Files to do the interfacing with Matlab & C/C++. Can you pls.give any suggestions. Thanks & Regards, Suyog. "Suyog Tapaswi" <suyog.tapaswi@yahoo.com> wrote in message <hd1fsp$2h5$1@fred.mathworks.com>... > Hi, > > I want to access some functions/data from C or C++ into Matlab. > So, is there any way apart fromthe Mex Files to do the interfacing with Matlab & C/C++. > Can you pls.give any suggestions. > > Thanks & Regards, >...

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 wish to use a c-shared library in a managed code environment, c#. For testing, I created a c-shared library, matlab_test.dll, using deploytool. This library contains only one function, 'matlab_test(test_string)' which accepts a string as a parameter. I'm using DllImport to create calls to unmanaged code: /// <summary> /// Initiate the matlab environment /// Matlab changed the interface without updating the documentation! /// _proxy must be added, for no apparent reason? /// Result: Hours wasted on matlab model. Thanx matlab-guys.. /// </summary> /// <returns>True if successfull, false otherwise</returns> [DllImport("mclmcrrt710.dll", EntryPoint = "mclInitializeApplication_proxy")] static extern bool InitiateMatlabApplication(string options, Int32 count); /// <summary> /// Terminate the matlab environment /// Matlab changed the interface without updating the documentation! /// _proxy must be added, for no apparent reason? /// Result: Hours wasted on matlab model. Thanx matlab-guys.. /// </summary> /// <returns>True if successfull, false otherwise</returns> [DllImport("mclmcrrt710.dll", EntryPoint = "mclTerminateApplication_proxy")] static extern bool TerminateMatlabApplication(); /// <summary> /// Create string t...

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

Hi everyone, My question is actually more related to C++ in VisualStudio and COM but since it is also heavily related to Matlab I have no other option than posting here. I would like to write a custom in-process COM server for MATLAB and use MATLAB as a COM client. I have succesfully implemented a server dll which generates the following keys under HKEY_CLASSES_ROOT when registered with !regsvr32 in matlab. HKEY_CLASSES_ROOT\CLSID\myclsid HKEY_CLASSES_ROOT\CLSID\myclsid\InProcSvr32 HKEY_CLASSES_ROOT\CLSID\myclsid\ProgID = myprogid HKEY_CLASSES_ROOT\CLSID\myprogid HKEY_CLASSES_ROOT\CL...

Hello, I want to use the COM Interface with a Delphi program but it doesn't work. Do I need some special Toolboxes to use the interface? The dlls mwcomutil and mwcommgr aren't in my win32 folder. Also the mwregsvr.exe isn't there. Is it possible to invoke a COM Object without these data? I'm using Matlab 2007b. Thanks for any help. Regards Daniel On Wed, 07 Apr 2010 10:23:07 -0300, Daniel <daniel.c.braun@web.de> wrote: > Hello, > I want to use the COM Interface with a Delphi program but it doesn't > work. What happens instead? &g...

Hi all. I have been integrating with a C interface into Matlab for about 2 years now and am quite familiar on how to do the data type conversions from C into Matlab. Recently, my boss gave me an assignment to make a DLL within Matlab so an engineer can access some data within Matlab. I am doing this interface through C using the function: void mexFunction( int nlhs, mxArray * plhs [], int nrhs, const mxArray * prhs [] ) { }. I am trying to convert a C string array into a Matlab array ( mxArray ). Previously when I was using C as a front end into Matlab compiled C functions, I wou...

Hi all! I use this version of Microsoft Visual C++ Express Edition Microsoft Visual Studio 2005 Version 8.0.50727.867 Microsoft .NET Framework Version 2.0.50727 SP2 Installed Edition: VC Express I use this version of Matlab: MATLAB Version 7.8.0.347 (R2009a) and i use this operating System: Microsoft Windows Vista Version 6.0 (Build 6001: Service Pack 1) Home premium I am trying to compile 'engwindemo.cpp' example but i take this error message: 1>Compiling... 1>win.cpp 1>.\win.cpp(39) : error C2664: 'MessageBox' : cannot convert parameter 2 from 'LPSTR' t...

hello , i need urgent help from u.i want to know how to create the interface between c LANGUAGE AND MATLAB.what i have to do is this- pass some data i.e. in form of array or matrix from c to matlab use some available function of matlab there on that data and return back the result in c programme. please help it is urgent. Thanks in advance ...

I am working on a project that involves interfacing three different routines together that are written in Matlab/Simulink, Fortran90, c++. The Matlab/Simulink program is the driver and it must be able to effectively communicate with the other two programs (It must have bi-directional communication that is as fast as possible). I would prefer not to use MEX technology. Does anyone know what the best approach would be to accomplish this task? Ken Yetzer wrote: > I am working on a project that involves interfacing three different > routines together that are written in Matlab/Simulink, Fo...

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

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

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

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

Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

At long last PayPal has updated its iOS app with a completely redesigned interface that optimizes the experience for iPhone 6/iPhone 6s and 6 ...

... post, Waze has uploaded a video straight to YouTube to tell us what’s new. Basically, we are looking at a complete refresh to the user interface, ...

... common charging infrastructure in this case refers to that provided [&hellip European Electric Bus Makers Will Work Toward Open Charging Interface ...

IoT is getting more automated, but not everything can be done by machines. An engineer who's been working with a system for decades has insights ...

Virtual reality faces numerous challenges, but one of the biggest is having to take your headset off whenever you need to run a conventional ...

LibreOffice 5.1, the latest iteration of the open-source office suite, adds new user interface elements. We examine highlights of the release. ...

AMD may be planning a new 32-core server CPU once Zen launches but whether that's a good thing or not depends on whether its an Intel bunker ...

The US Patent Office has released a batch of patents assigned to Apple, and one of them details a new way of identifying yourself and allowing ...

... industrial site pinpoints sound coming from a passing truck as well as from equipment on the other side of a buildling. (Credit: Signal Interface ...

Resources last updated: 3/22/2016 3:08:39 AM