--- /dev/null
+## function str=headerstring(what,value,kind)
+## used by writeheader
+## returns a string for incorporation in an edf-header
+## what is the information item (e.g. 'Dim_1')
+## value of the item
+## kind is string, char, integer, logical, float or double
+## origin: peter
+##
+## 30.09.2009 (HSu): Updated to work with double and char data types
+## 2011-08-29 PC
+## * add logical data type
+
+function str=headerstring(what,value,kind)
+
+ str=[what ' = '];
+
+ switch kind
+ case {'string', 'char'},
+ str=[str sprintf('%s ',value')];
+ case {'integer', 'logical'},
+ str=[str sprintf('%i ',value')];
+ case {'float', 'double'}
+ str=[str sprintf('%g ',value')];
+ otherwise
+ printf("Unknown data type in header %s\n",kind);
+ end
+
+ str = [str sprintf(';\n')];
+end