MATLAB: Importing/Cleaning .txt file (strings to useable data) (rainfall sample problem)

Опубликовано: 12 Октябрь 2024
на канале: Engineering with Dr. Kelsey Joy
738
14

In this video I go through how to change a large text file (.txt) that imports into MATLAB as strings in cells to accessible (separated/organized) set of data consisting of cell arrays with strings and numbers. I received a set of data from a subscriber. In this video I go through the process of familiarizing myself with the data set and figuring out how to make it accessible so I could analyze it for the given problem. I will be analyzing the data in a future video.

Here is a link to the data used and program developed in this video: https://www.mathworks.com/matlabcentr...


To continue this rainfall project, watch the next video on analysis:    • MATLAB: Analyze Rainfall Data - Stand...  

Check this playlist of videos about techniques to import and analyze Excel data in MATLAB:    • Everything MATLAB + Excel tutorial an...  

I also have a MATLAB tutorial playlist if you are looking for help with anything from the basics to more complex ideas:
   • How to Create Programs in MATLAB (tut...  

#MATLAB #learntocode #engineeringstudent #engineeringstudents #engineering #engineer #coding #code #programming #program #cleandata #analyzedata

The first thing I do in this video is read in the .txt data file with the readcell function.
Then I explore the data set to figure out what type of data I have and how I can parse it out.
I parse out the locations first, then the amount of rainfall for each day.

Chapters:
00:00 Introduction
01:00 Separating out the different locations
18:37 Exploring the header for the numeric data
19:26 Investigating the raw numeric data
21:57 Create user-defined function to turn a string of numbers to cell array of numeric data (double)
25:09 Missing data (how to handle null in data set)
29:47 Convert string of numbers and spaces TO useable numbers
36:26 Discussion about parsing out data manually vs. creating a program to do this
38:04 Finding spaces in string of text (isspace function) and parsing out numbers
51:40 Augmenting data together
52:30 Turning script file to user-defined function
53:40 Calling programmer-defined function
54:36 Troubleshooting error in programmer-defined function for full data set
56:01 Final run (updated/parsed out data)