Readmatrix reading csv files incorrectly by replacing values with NaN and adding a third column
Hi all,
I have 10 ".csv" files which I am importing into MATLAB using the readmatrix function. All of these files are identical as follows:
Rows: 1000001 – First row has headers (Time [s], Volts [V]))
Columns: 2
All but two files are not being imported correctly. I have tried opening them in text editors to verify the comma delimiter and it is correct. I do not know what the issue is. For these two files, MATLAB reads the second (Volts) column as NaN and adds a third NaN column to it.
Kindly please help.
The line of code I am using is: variable_x = readmatrix(‘filename’);
A short excript is as follows:
Important to note that I have also tried the ‘range’ and ‘delimiter’ options explicitly to no avail. Might be a bug. I am using R2023bHi all,
I have 10 ".csv" files which I am importing into MATLAB using the readmatrix function. All of these files are identical as follows:
Rows: 1000001 – First row has headers (Time [s], Volts [V]))
Columns: 2
All but two files are not being imported correctly. I have tried opening them in text editors to verify the comma delimiter and it is correct. I do not know what the issue is. For these two files, MATLAB reads the second (Volts) column as NaN and adds a third NaN column to it.
Kindly please help.
The line of code I am using is: variable_x = readmatrix(‘filename’);
A short excript is as follows:
Important to note that I have also tried the ‘range’ and ‘delimiter’ options explicitly to no avail. Might be a bug. I am using R2023b Hi all,
I have 10 ".csv" files which I am importing into MATLAB using the readmatrix function. All of these files are identical as follows:
Rows: 1000001 – First row has headers (Time [s], Volts [V]))
Columns: 2
All but two files are not being imported correctly. I have tried opening them in text editors to verify the comma delimiter and it is correct. I do not know what the issue is. For these two files, MATLAB reads the second (Volts) column as NaN and adds a third NaN column to it.
Kindly please help.
The line of code I am using is: variable_x = readmatrix(‘filename’);
A short excript is as follows:
Important to note that I have also tried the ‘range’ and ‘delimiter’ options explicitly to no avail. Might be a bug. I am using R2023b readmatrix, csv, nan MATLAB Answers — New Questions