I believe there is more to this question than what you asked, but I'll answer your question as-is.
Samurai weapons were used for many things. Both in combat, training, lessons, various ways of execution (one was impaling yourself in the chest with your own sword if you wanted to die honorably according to tradition)
~Hope this helps!