What to do when research leads to poor results? I am an MSc graduate and work as an independent researcher. I spent 10 months on a paper. I wrote many scripts in Matlab to implement four other comparative methods as well as a new method that my MSc professor had proposed. Each of these methods was so difficult to implement.

Unfortunately, the method that I was going to propose does not work well compared to the comparative methods, which were introduced already 3-4 years ago.

What should I do now?
I recommend that you record your failures and not just your successes.  In your case, I suggest you write a technical report giving all the details (the implementation, the comparison, the conclusion).  It may not be considered as a publication worthy of your resumé, but at least it serves to document your efforts and may prove to be useful in the future (in case other people are thinking of using your proposed method).

Also note that your method may appear worse when compared to others using a certain metric (say, time complexity) but may appear better when compared to others using a different metric (say, space complexity).  You might want to look at your method again.