Regression using RBF kernel

What you are doing is correct - I am not sure I understand what you meant when you said it doesnt work? I guess you are working on a same ARD problem in your other post, maybe you can put up a notebook with some simulation data to show the things you have tried with the error and intended output?