How to import data with '?'s to feed into knnimpute
Mostra commenti meno recenti
Hi community! So I have a csv file where I want to import the csv numbers on each line into a row of a matrix. For instance:
1, 3, 4 1, 2, 5
would import into matrix [1 3 4; 1 2 5]. There are various ways to do this is matlab (csvread, for instance), but they don't handle '?'s.
How can I convert this type of data into a form that knnimpute can handle as an input? The examples all have matrixes with NaN values, but I am having trouble turning my data into a matrix with NaN values where my '?'s are.
Thanks for any advice or comments, all appreciated
1 Commento
per isakson
il 25 Nov 2014
See textscan:
- 'EmptyValue' — Returned value for empty numeric fieldsNaN (default) | scalar
- 'TreatAsEmpty' — Strings to treat as empty valuestring | cell array of strings
Risposte (0)
Categorie
Scopri di più su Data Type Conversion in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!