matlab - Import data from file delimited with various number of spaces -


I am trying to read in a data array in a data array, but there are two problems

1) The delimiter is an empty space which varies in each column

2) Among the entries in 4 columns, there are question marks instead of numbers

This data is read in a cell What is the best way to array the file? Try the following:

x = IMPORTDATA ('auto- mpg.data '); % // Reading Line y = Room (number (x), 9); Prellocate with 9 cols (acccording to your file) for N% 1: numel (x) y (n, :) = regexp (x {n}, '(\ s \ s +) | \ t', ' split '); To divide each line, split each row into more than one place or one tab% // (according to your file)

398x 9 in cell The array of stars y

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -