I have two CSV files, both produced by the same software, according to the same template. Both files look the same when opened in Excel, and cells are all of the content type "General". The only difference is the last few rows, which in one case have been deleted.
However, when reading the CSVs into Matlab with readtable, the first column/variable is formatted differently, in one case as cell ('1') and in the other case as double (1), as can be seen below. All other variables are formatted identically, which makes this so strange.
>> T = readtable('02.csv', 'readvariablenames', true)T = rep file condition corrAns n notes_started_mean notes_started_raw notes_started_std notes_stopped_mean notes_stopped_raw notes_stopped_std phrase_started_mean phrase_started_raw phrase_started_std phrase_stopped_raw rating_response_mean rating_response_raw rating_response_std rating_rt_mean rating_rt_raw rating_rt_std rating_started_mean rating_started_raw rating_started_std rating_stopped_raw rating_text_started_mean rating_text_started_raw rating_text_started_std rating_text_stopped_raw takeBreak_started_raw takeBreak_stopped_raw order _________________ __________________ _________ _______ ___ __________________ _________________ _________________ __________________ _________________ _________________ ___________________ __________________ __________________ __________________ ____________________ ___________________ ___________________ ______________ _____________ _____________ ___________________ __________________ __________________ __________________ ________________________ _______________________ _______________________ _______________________ _____________________ _____________________ _____ '1' 'stimuli/09C4.wav' 'C4' 1 1 135.42 135.42 0 144.58 144.58 0 135.4 135.4 0 NaN 2 2 0 1.676 1.676 0 9.2157 9.2157 0 NaN 144.58 144.58 0 NaN NaN NaN 0
and
>> T = readtable('03.csv', 'readvariablenames', true)T = rep file condition corrAns n notes_started_mean notes_started_raw notes_started_std notes_stopped_mean notes_stopped_raw notes_stopped_std phrase_started_mean phrase_started_raw phrase_started_std phrase_stopped_raw rating_response_mean rating_response_raw rating_response_std rating_rt_mean rating_rt_raw rating_rt_std rating_started_mean rating_started_raw rating_started_std rating_stopped_raw rating_text_started_mean rating_text_started_raw rating_text_started_std rating_text_stopped_raw takeBreak_started_raw takeBreak_stopped_raw order ___ __________________ _________ _______ _ __________________ _________________ _________________ __________________ _________________ _________________ ___________________ __________________ __________________ __________________ ____________________ ___________________ ___________________ ______________ _____________ _____________ ___________________ __________________ __________________ __________________ ________________________ _______________________ _______________________ _______________________ _____________________ _____________________ _____ 1 'stimuli/14C1.wav' 'C1' 2 1 171.52 171.52 0 178.34 178.34 0 171.51 171.51 0 NaN 2 2 0 1.021 1.021 0 6.8371 6.8371 0 NaN 178.34 178.34 0 NaN NaN NaN 0
Best Answer