Thursday, September 20, 2007

LIBSVM MATLAB interface: invalid MEX-file

I am using LIBSVM on MATLAB 2006b currently. The LIBSVM is working well in my computer. However, when I copied my code to my friend's computer and attempted to run it, an error occurred:

invalid MEX-file
The specified module could not be found.


This is may be caused by the MEX libraries. That is your local MEX libraries are different from those used to compile the MEX files. Recompile the MEX source file should solve this problem.

Friday, September 07, 2007

Roman numerals in Latex

Ok, we have to admit that it is not easy to input roman numerals in Latex. There is still a way.

In the preamble, i.e. before \begin{document}, define

\makeatletter
\newcommand{\rmnum}[1]{\romannumeral #1}
\newcommand{\Rmnum}[1]{\expandafter\@slowromancap\romannumeral #1@}
\makeatother

Then in the document part, \rmnum{num} is used to input the roman numeral of num, \Rmnum is for the uppercase. If you prefer to use other commands, just change the red part in the definition part.

If only lowercase roman numerals are occasionally used, \romannumeralnum can do it. In this approach, definition is not necessary.

Someone anonymous commented that "Nice, but it fails for N=4000 and above." However, in my system, it is working for 4000 and above.

Update: again, someone anonymous pointed out that MMMM is not allowed. Based on the information I found on the Internet, it is OK. But once the number goes bigger again, the convert is not correct.