Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use Matlab code with visual C?

Status
Not open for further replies.

musharaf

Newbie level 4
Joined
Apr 18, 2007
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,315
can anyone help ,how to use matlab code in visual c or how to import matlab code in visual c
 

matlab with visual c

u can use the codes with very few amdts in .M files.
there are many softwares available for conversion of matlab to C++ on the internet
 

Re: matlab with visual c

Try search for mex.h which is a header file for C. MEX related functions that can be used to exchange data between Matlab and C. I can send you tutorials on this topic however you can search Matlab Help for External Interfaces
 

Re: matlab with visual c

MATLAB has support for API calls. Look for material on Programming MATLAB with MATLAB API. If u have access to MATLAB Manuals, a separate volume on MATLAB API Programming is available with indepth info on how to use matlab functions from visual c.
 

matlab with visual c

Maybe this will help you:
"Calling MATLAB from C and Fortran Programs"
**broken link removed**
 

Re: matlab with visual c

An example for u.

#include "stdafx.h"

int main(int argc, char* argv[])
{
double dblArray[]={1, 2, 3, 4, 5, 6, 7, 8, 9};
mxArray *A, *B;
A=mxCreateDoubleMatrix(3, 3, mxREAL);

//copy array to matrix A

memcpy(mxGetPr(A), dblArray, 9 * sizeof(double));



A=mlfMTimes(A, A); //A=A.^2;

mlfPrintMatrix(A); //Creating Magic Matrix

B=mlfMagic(mlfScalar(3)); //Magic matrix of order 3
mlfPrintMatrix(B);
mxDestroyArray(A);
mxDestroyArray(B);
return 0;
}


More info available here:

h**p://www.codeproject.com/samples/MATLAB_C_API.asp
 

matlab with visual c

You can use Matlab C Compiler (type help mcc)
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top