function fid=svgheader(filename, width, height)
% fid=svgheader(filename)
% 
% Start writing an svg file

fid=fopen(filename, 'w');

if fid <= 0
  error('failed to open file');
end

fprintf(fid, '%s\n', '<?xml version="1.0" standalone="no"?>');
fprintf(fid, '%s\n', '<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" ');
fprintf(fid, '%s\n', '"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">');
fprintf(fid, '<svg width="%f" height="%f" version="1.1" xmlns="http://www.w3.org/2000/svg"> \n', width, height); 