Trouble with import text file into Matlab
Afficher commentaires plus anciens
Hi, Recently, I upgraded from matlab 2012b to matlab 2016a.
I neet to import some data stored in text files into matlab.

There are two columns in each file and are seperated by tab(\t in C).
I just use the Import Data menu.
When I imported the first file, matlab would auto name the first column VarName1 and the second column VarName2.

However, if I import the second file, matlab would name the both columns VarName3

In the old version of Matlab, when I did the same thing, matlab would auto name them VarName3 and VarName4.
I know I could change the name then import the data. But does anyone how what's wrong with that.
Thank you!
1 commentaire
dpb
le 9 Août 2016
Réponses (1)
Rob Jacobs
le 10 Août 2016
0 votes
This is happening because your first import created variables 'VarName1' and 'VarName2' in your workspace. When you open the next file, the Import Tool is avoiding giving the same variable names, because if you imported them a second time, they would overwrite the ones in the workspace. Hence you get 'VarName3' and 'VarName4' instead.
1 commentaire
Henry
le 10 Août 2016
Catégories
En savoir plus sur Text Data Preparation dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!