>> cheby_u_test 28-Sep-2013 16:34:34 CHEBY_U_TEST MATLAB version Demonstrate a simple use of the MEX compiler, which allows MATLAB to call C++ functions. Get a directory listing. The file CHEBY_U.CPP should be there. cheby_u.cpp cheby_u_test_output.txt fact.mexa64 fact_test_output.txt cheby_u_test.m fact.cpp fact_test.m matlab_calls_c.html Compile the file CHEBY_U.CPP. Warning: You are using gcc version "4.4.7". The version currently supported with MEX is "4.3.4". For a list of currently supported compilers see: http://www.mathworks.com/support/compilers/current_release/ Get a directory listing. A new file should show up, containing the compiled information. cheby_u.cpp cheby_u_test_output.txt fact_test.m cheby_u.mexa64 fact.cpp fact_test_output.txt cheby_u_test.m fact.mexa64 matlab_calls_c.html Now use CHEBY_U as though it were a MATLAB M-file function. Evaluation point X = 0.200000 N U(N,X) U(N,X) (computed) (tabulated) 0 1.000000 1.000000 1 0.400000 0.400000 2 -0.840000 -0.840000 3 -0.736000 -0.736000 4 0.545600 0.545600 5 0.954240 0.954240 6 -0.163904 -0.163904 7 -1.019802 -1.019802 8 -0.244017 -0.244017 9 0.922195 0.922195 10 0.612895 0.612895 11 -0.677037 -0.677037 12 -0.883709 -0.883709 CHEBY_U_TEST: Normal end of execution. 28-Sep-2013 16:34:34 >>