Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
load(filename) but should use importdata cuz it's text file
Posted
Updated 26-Dec-13 21:32pm
v4
Comments
Peter Leow 25-Dec-13 9:35am    
Are you trying to do data pre-processing for subsequent data mining? Why matlab? You have to do it manually in order to detect and correct problems like missing data, incorrect data type, repeat data etc. You may want to engage the help of ms excel to speed up the task. Import the original text file into an excel sheet and use the excel facilities (search, replace, sort etc) to help you to manipulate and clean the data.

There are a number of ways to deal with missing value, one of them is to replace it with the average of all other available values if it is a number, or one of the major category if it is a categorical value.

Only after a proper data pre-processing, can you test the data in your matlab code.

1 solution

As you wish, check this documents out at MathWorks:

Read Data from Text File in MatLab

Manipulate String in MatLab

Happy coding.
 
Share this answer
 
v2
Comments
Nelek 27-Dec-13 3:47am    
My 5
Peter Leow 27-Dec-13 3:49am    
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900