I use the following code to read the block below.
fid = fopen('data.csv');C = textscan(fid,'%s%f%f%f%f%f%f%f%f','headerlines',1,'delimiter',';');fclose(fid);
Because of the single '-' characters in data.csv this does not work yet. I want to ignore single '-' characters from the input and use NaN values there.
How can I read single '-' characters as NaN? I tried 'TreatAsEmpty' but this leads to the situation where negative values are transformed to positive. Because negative values also include a '-' character, and 'TreatAsEmpty' also removes these.
Block:
Headerline01-01-2006 (00 uur);-;-1.61;-;-0.70;-;1;-;23901-01-2006 (01 uur);-;-1.66;-;-0.70;-;-;-;110801-01-2006 (02 uur);-;-1.68;-;-0.75;-;1;-;182701-01-2006 (03 uur);-;-1.64;-;-0.77;-;-;-;-01-01-2006 (04 uur);-;-1.62;-;-0.74;-;-;-;-01-01-2006 (05 uur);-;-1.61;-;-0.74;-;1;-;205301-01-2006 (06 uur);-;-1.66;-;-0.75;-;-;-;287001-01-2006 (07 uur);-;-1.68;-;-0.80;-;0;-;358501-01-2006 (08 uur);-;-1.64;-;-0.80;-;-;-;-01-01-2006 (09 uur);-;-1.63;-;-0.79;-;-;-;-01-01-2006 (10 uur);-;-1.62;-;-0.77;-;-;-;-01-01-2006 (11 uur);-;-1.62;-;-0.74;-;1;-;3967
[EDITED, Jan, code and file contents formatted]
Best Answer