I managed solve this question myself, all you have to do is modify the columnlegend to include a handle specifying the corresponding plots you wanted to include in the legend. This means modifying the column legend code to have an extra argument - handle of the plot h1 = plot(...). where h(i) vector stores all the h1 handle of the plots that you wanted to include in the legend section. Columnlegend(h,numofcolumns,...) and modify the create legend function (h) inside the function.
So pass h = [h1 h1 h1 h1 ....] into Columnlegend.




