How to call a program in C from Matlab
Mostra commenti meno recenti
I used to call a program in C to change parameters in a camera, since the product came with examples in this language.But for sake of automation it would be more efficient do it all from a main program in Matlab.-The key is how to pass the values to the functions and make that the program in c read the values from the functions in my "m" file.Command System works for me, but if there is another way to dothis...I appreciate a clue
Risposte (1)
Kaustubha Govind
il 26 Mar 2012
1 voto
4 Commenti
Warren
il 26 Mar 2012
Geoff
il 27 Mar 2012
Wrapping your camera control code with MEX should not be a problem if you are familiar with C. You simply create a C source file with the MEX entry function, #include your camera-control stuff in that file, and translate the supplied MatLab parameters into their C equivalent. There is a lot of MEX example code on the web that gives you the basic MatLab API calls. From there, it's just ordinary C.
Jan
il 27 Mar 2012
@Warren: The Mex-gateway is the best solution. If this interface is "overwhelming" for you, this forum is a good location to post your trials and ask specific questions about the mex<> and mx<> commands.
Kaustubha Govind
il 27 Mar 2012
I agree with Geoff and Jan!
Categorie
Scopri di più su Write C Functions Callable from MATLAB (MEX Files) in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!