Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



import data in matlab
Posted:
Apr 15, 2009 6:26 PM


hi,
just started using matlab. I have the following problem. I think it is sort of standard but i couldn't figure out how to deal with it.
I have data in .txt format that look like
var1 var2 var3 1 . 3 2 6 4 2 3 5
I have about 141 vars and 90k obs. I'd like to drop the rows with missing values. I found i can use the command X(any(isnan(X),2),:) = [];. In order to do that i have to import the data separating the name of the variable from the matrix (through the import wizard). Since different variables have more or less missing values i cannot do this importing them as separate vectors...
then i need to perform some calculations like newvar=f(var1, var2, var3)... How do I say to Matlab that var1 is actually the first column of the matrix, var2 the second and so on?
thanks, Andrea



