|
"Wayne King" <wmkingty@gmail.com> wrote in message <hdunfk$6kg$1@fred.mathworks.com>...
> "Steve C" <stephen.cutler@baesystems.com> wrote in message <hdumfk$46t$1@fred.mathworks.com>...
> > After spending some time converting a 'C' program into a MATLAB script file in order to incorporate it into our suite of MATLAB based data processing routines, I am now wondering if I could run the 'C' program in MATLAB? It would need to access data created from another MATLAB script stored locally. I thought translating it into MATLAB would improve it's efficiency as it would be running on MATLAB, but having read something about 'MEX-files' I am becoming uncertain. Any quick-start guide to running 'C' programs as M-file scripts would be most helpful.
>
> Hi Steve,
>
> see
>
> >>doc mex
>
> and also in the Matlab User Guide -> External Interfaces -> Creating C/C++ Language MEX-files
>
> wayne
Wayne,
Thanks for taking the time out to reply to my query, I have had a look at 'doc mex' and 'Creating C/C++ Language MEX-files' and attempted to implement them into my program.
However, there is mention of using 'mexfunction' instead of 'main()' in my 'C' program, so do I just overwrite the text 'main(vars)' with 'mexfunction' thus renaming the main function? Or, is it a case of copy-and-pasting the main function to the end of the file and calling it mexfunction. The intricacies of the help files for those of us who are definitely more beginner than intermediate is where they are let down.
Regards
Steve
|