To add X and Y grids to plots :
grid on;
To add Y only grid:
set(gca,'XGrid','off','YGrid','on');
To add X only grid
set(gca,'XGrid','on','YGrid',’off');
To add X and Y grids to plots :
grid on;
To add Y only grid:
set(gca,'XGrid','off','YGrid','on');
To add X only grid
set(gca,'XGrid','on','YGrid',’off');