Hi,
I understand that you are trying to use the 'smooth' function on each of the connected components/curved lines that you got using the 'bwskel' function.
Using the 'bwlabel' fuction, each of the connected component in the corresponding image can be given a label number. This label can be used with the 'find' function to smooth the line with the corresponding label number. You can refer to the following code.
[skel_label N]=bwlabel(BW1);
figure()
imshow(i)
hold on;
for i=1:N
[coor1 coor2]=find(skel_label==i); % Finding all the co-ordinates for the corresponding component
yy1 = smooth(coor2,coor1,0.5,'loess');
plot(coor2,yy1,'x');
end
hold off;