Alias blanks in the cell array as a string.
I am using the ‘importdata’ function to read a text file. It reads the numeric data as a matrix and text data as a cell array; now the first element of cell array is all the headers, I use a ‘strsplit’ function to separate each individual variable name in header. The issue is that there are some blank columns in the text file, so the numeric matrix reads it as a ‘NaN’ but the resulting variables (which I used ‘strsplit’ for) eliminates blanks. Now the result is that size(textdata,2) +size(data,2) is not equal to size(variable,2). I want to read blanks in the header as a variable, alias it as ‘empty’I am using the ‘importdata’ function to read a text file. It reads the numeric data as a matrix and text data as a cell array; now the first element of cell array is all the headers, I use a ‘strsplit’ function to separate each individual variable name in header. The issue is that there are some blank columns in the text file, so the numeric matrix reads it as a ‘NaN’ but the resulting variables (which I used ‘strsplit’ for) eliminates blanks. Now the result is that size(textdata,2) +size(data,2) is not equal to size(variable,2). I want to read blanks in the header as a variable, alias it as ‘empty’ I am using the ‘importdata’ function to read a text file. It reads the numeric data as a matrix and text data as a cell array; now the first element of cell array is all the headers, I use a ‘strsplit’ function to separate each individual variable name in header. The issue is that there are some blank columns in the text file, so the numeric matrix reads it as a ‘NaN’ but the resulting variables (which I used ‘strsplit’ for) eliminates blanks. Now the result is that size(textdata,2) +size(data,2) is not equal to size(variable,2). I want to read blanks in the header as a variable, alias it as ‘empty’ textscan, imporatdata, strsplit MATLAB Answers — New Questions