In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the method of reading csv files by matlab. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Matlab reads the csv file: first open the "matlab" software on the computer, and find the csv file on the computer; then enter the code in the command line window at the arrow, and the command is [csvread ()]; finally, the directory + file name of the csv file is in parentheses.
The method for matlab to read csv files:
1, first open the "matlab" software on the computer, the main interface is shown in the following picture, and the command line window at the arrow can be run by entering the code.
2. Then find the csv file on your computer, as shown in the following figure. The name of the csv file is data .csv.
3. The command for matlab to read the csv file is csvread (), and the directory + file name of the csv file is shown in parentheses. The directory for data .csv is C:\ Users\ 50123\ Desktop\ data .csv. The directory of each file is different, just look at the properties of the file.
4, if you need to output a specific column of the csv file, use a=csvread (filename,1,2) to output the second line to the fourth line and the third column to the fourth column of the file. The output results are shown in the following figure. When matlab reads the csv file, 0 is the first line and the first column.
5. Use the command a=csvread (filename,1,0, [1j0jin2jin3]) to output the second line to the third line and the first column to the fourth column of the file. The output result is shown in the following figure.
6, if the file is full of data, you can drag the file to the workspace of matlab, the system pop-up window is shown below, and you can see the data in the file at the arrow.
7. Select the data to be exported, and select the type of imported data in "imported data", where you can export it as a column vector or numerical matrix. Click Import selection at the arrow to export the data.
8. Then you can see the exported data in the workspace of matlab, as shown in the following figure.
This is the end of this article on "matlab's method of reading csv files". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.