how run .c program in matlab

if i have program print.c
#include<stdio.h>
#include<conio.h>
main()
{
printf('hello')
getchar()
}
how i can run this code in MATLAB

 采纳的回答

Shashank Prasanna
Shashank Prasanna 2013-1-29

2 个投票

If you want to call your C function from within MATLAB you have to create a MEX file. Which mean you will have to modify your C code with the following guidelines:

8 个评论

Or compile your C code in your favourite C programming environment into a dll/shared object and use loadlibrary to run it inside MATLAB.
How about now? I guess I can call C directly without the compiling. I am curious about it.
It is not possible to call C or C++ directly from MATLAB without compiling the C or C++.
The links are not working anymore
indeed the links do not work anymore...
thank you Walter

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Write C Functions Callable from MATLAB (MEX Files) 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by