Close all instruments

g = instrfind;
for k=1:length(g)
    fclose(g(k));
    delete(g(k));
end
clear g os fg;