MATLAB: How to take text files and turn the data into variables

datar2015atxt

When I try to use the automated function produced by the Import Tool it never works. I'm not quite sure what I'm doing wrong but it must be something. For example I am trying to take data in a text file ( organized in order across the top Time Angle Velocity Acceleration) and turn them into variables to be used in Matlab. I'm new to trying this and so any simple explanation could go a long way. Thank You

Best Answer

I would have to see your file to provide a definitive reply. My favourite function for text file reading is textscan. It might initially appear a bit complicated to use, but it’s actually straightforward. It has several options because it needs them to work and play well with different text files.