Home >Common Problem >How to read txt text data in matlab
The method for matlab to read txt text data: first open a txt file and keep the address of the folder; then use a textread function, and substitute the txt file path inside the function; finally, draw the xy graphic.
#The operating environment of this article: Windows 7 system, matlab version 7.0, Dell G3 computer.
How matlab reads txt text data:
1. Open a txt file, we will find that it has both characters and values.
#2. At this time, we delete all characters, leaving only useful data values.
#3. Remember the address of the folder, which will be used as a path for matlab reading later.
#4. At this time, use a textread function, and substitute the txt file path just now inside the function.
#5. The textread function is relatively stupid and will read these data into 1 as a vector. We divide it into two columns, represented by x and y.
#6. Finally, you can get the xy graph by drawing, so this method is simple and effective.
The above is the detailed content of How to read txt text data in matlab. For more information, please follow other related articles on the PHP Chinese website!