Home > Common Problem > How to read txt text data in matlab

How to read txt text data in matlab

coldplay.xixi
Release: 2023-01-13 00:25:14
Original
74252 people have browsed it

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.

How to read txt text data in matlab

#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.

How to read txt text data in matlab

#2. At this time, we delete all characters, leaving only useful data values.

How to read txt text data in matlab

#3. Remember the address of the folder, which will be used as a path for matlab reading later.

How to read txt text data in matlab

#4. At this time, use a textread function, and substitute the txt file path just now inside the function.

How to read txt text data in matlab

#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.

How to read txt text data in matlab

#6. Finally, you can get the xy graph by drawing, so this method is simple and effective.

How to read txt text data in matlab

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template